Skip to content

Commit

Permalink
Merge pull request #88 from stekycz/bugfix/nette-2.3-case-sensitivity
Browse files Browse the repository at this point in the history
Fixed notice caused by missing key in array
  • Loading branch information
fprochazka committed Feb 21, 2015
2 parents c1ab1ce + ca98e2a commit 00de2c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WebLoader/Nette/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ private function addWebLoader(ContainerBuilder $builder, $name, $config)
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$meta = $class->properties['meta'];
$meta->value['types']['webloader\\loaderfactory'] = $meta->value['types']['webloader\\nette\\loaderfactory'];
if (array_key_exists('webloader\\nette\\loaderfactory', $meta->value['types'])) {
$meta->value['types']['webloader\\loaderfactory'] = $meta->value['types']['webloader\\nette\\loaderfactory'];
}
if (array_key_exists('WebLoader\\Nette\\LoaderFactory', $meta->value['types'])) {
$meta->value['types']['WebLoader\\LoaderFactory'] = $meta->value['types']['WebLoader\\Nette\\LoaderFactory'];
}

$init = $class->methods['initialize'];
$init->addBody('if (!class_exists(?, ?)) class_alias(?, ?);', array('WebLoader\\LoaderFactory', FALSE, 'WebLoader\\Nette\\LoaderFactory', 'WebLoader\\LoaderFactory'));
Expand Down

0 comments on commit 00de2c8

Please sign in to comment.