From 3f30ceea1b6d47e8e0f96e76550320d1e8eac400 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 5 Feb 2015 07:10:00 +0100 Subject: [PATCH] extensions: updated for recent nette/di --- src/Bridges/ApplicationDI/ApplicationExtension.php | 9 ++++----- src/Bridges/ApplicationDI/RoutingExtension.php | 2 +- tests/Application/MicroPresenter.response.phpt | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Bridges/ApplicationDI/ApplicationExtension.php b/src/Bridges/ApplicationDI/ApplicationExtension.php index 4cf7cd411..48f05f745 100644 --- a/src/Bridges/ApplicationDI/ApplicationExtension.php +++ b/src/Bridges/ApplicationDI/ApplicationExtension.php @@ -81,15 +81,14 @@ public function beforeCompile() $container = $this->getContainerBuilder(); $all = array(); - foreach ($container->findByType('Nette\Application\IPresenter', FALSE) as $name) { - $def = $container->getDefinition($name); - $all[strtolower($def->getClass())] = $def; + foreach ($container->findByType('Nette\Application\IPresenter') as $def) { + $all[$def->getClass()] = $def; } $counter = 0; foreach ($this->findPresenters() as $class) { - if (empty($all[$tmp = strtolower($class)])) { - $all[$tmp] = $container->addDefinition($this->prefix(++$counter))->setClass($class); + if (empty($all[$class])) { + $all[$class] = $container->addDefinition($this->prefix(++$counter))->setClass($class); } } diff --git a/src/Bridges/ApplicationDI/RoutingExtension.php b/src/Bridges/ApplicationDI/RoutingExtension.php index fc3188a78..02f1df48d 100644 --- a/src/Bridges/ApplicationDI/RoutingExtension.php +++ b/src/Bridges/ApplicationDI/RoutingExtension.php @@ -67,7 +67,7 @@ public function beforeCompile() public function afterCompile(Nette\PhpGenerator\ClassType $class) { if (!empty($this->config['cache'])) { - $method = $class->methods[Nette\DI\Container::getMethodName($this->prefix('router'))]; + $method = $class->getMethod(Nette\DI\Container::getMethodName($this->prefix('router'))); try { $router = serialize(eval($method->getBody())); } catch (\Exception $e) { diff --git a/tests/Application/MicroPresenter.response.phpt b/tests/Application/MicroPresenter.response.phpt index 6317dd329..37a36b4d9 100644 --- a/tests/Application/MicroPresenter.response.phpt +++ b/tests/Application/MicroPresenter.response.phpt @@ -33,7 +33,7 @@ class MicroContainer extends Nette\DI\Container protected $meta = array( 'types' => array( - 'nette\\bridges\\applicationlatte\\ilattefactory' => array(1 => array('latte.latteFactory')), + 'Nette\\Bridges\\ApplicationLatte\\ILatteFactory' => array(1 => array('latte.latteFactory')), ), );