@@ -9,13 +9,6 @@ |
||
9 | 9 | |
10 | 10 | namespace PPI\Framework\Router\Loader; |
11 | 11 | |
12 | -use Illuminate\Http\Request; |
|
13 | -use Illuminate\Routing\Route; |
|
14 | -use Illuminate\Routing\Router; |
|
15 | -use Illuminate\Events\Dispatcher; |
|
16 | -use Illuminate\Container\Container; |
|
17 | -use Symfony\Component\HttpFoundation\Response; |
|
18 | - |
|
19 | 12 | use Illuminate\Routing\Router as LaravelRouter; |
20 | 13 | |
21 | 14 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function load($path) |
45 | 45 | { |
46 | 46 | |
47 | - if(!is_readable($path)) { |
|
47 | + if (!is_readable($path)) { |
|
48 | 48 | throw new \InvalidArgumentException('Invalid laravel routes path found: ' . $path); |
49 | 49 | } |
50 | 50 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // The included file must return the laravel router |
55 | 55 | include $path; |
56 | 56 | |
57 | - if(!($router instanceof LaravelRouter)) { |
|
57 | + if (!($router instanceof LaravelRouter)) { |
|
58 | 58 | throw new \Exception('Invalid return value from ' |
59 | 59 | . pathinfo($path, PATHINFO_FILENAME) |
60 | 60 | . ' expected instance of LaravelRouter' |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2015 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * @link http://www.ppi.io |
|
8 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2015 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * @link http://www.ppi.io |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace PPI\Framework\Router\Wrapper; |
11 | 11 |
@@ -22,7 +22,6 @@ |
||
22 | 22 | use PPI\Framework\View\TemplateLocator; |
23 | 23 | use PPI\Framework\View\TemplateNameParser; |
24 | 24 | // Mustache |
25 | -use Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader; |
|
26 | 25 | use Symfony\Component\Templating\Helper\AssetsHelper; |
27 | 26 | // Twig |
28 | 27 |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * |
|
8 | - * @link http://www.ppi.io |
|
9 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * |
|
8 | + * @link http://www.ppi.io |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace PPI\Framework\ServiceManager\Config; |
12 | 12 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $serviceManager->get('templating.helper.assets'), |
125 | 125 | new RouterHelper($serviceManager->get('router')), |
126 | 126 | new SessionHelper($serviceManager->get('session')), |
127 | - ) |
|
127 | + ) |
|
128 | 128 | ); |
129 | 129 | |
130 | 130 | $engine->addGlobal('app', $serviceManager->get('templating.globals')); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | /* |
76 | 76 | * Templating Locator. |
77 | 77 | */ |
78 | - $serviceManager->setFactory('templating.locator', function ($serviceManager) use ($appCacheDir) { |
|
78 | + $serviceManager->setFactory('templating.locator', function($serviceManager) use ($appCacheDir) { |
|
79 | 79 | return new TemplateLocator( |
80 | 80 | $serviceManager->get('file_locator'), |
81 | 81 | $appCacheDir |
@@ -85,28 +85,28 @@ discard block |
||
85 | 85 | /* |
86 | 86 | * Templating Name Parser. |
87 | 87 | */ |
88 | - $serviceManager->setFactory('templating.name_parser', function ($serviceManager) { |
|
88 | + $serviceManager->setFactory('templating.name_parser', function($serviceManager) { |
|
89 | 89 | return new TemplateNameParser($serviceManager->get('modulemanager')); |
90 | 90 | }); |
91 | 91 | |
92 | 92 | /* |
93 | 93 | * Filesystem Loader. |
94 | 94 | */ |
95 | - $serviceManager->setFactory('templating.loader.filesystem', function ($serviceManager) { |
|
95 | + $serviceManager->setFactory('templating.loader.filesystem', function($serviceManager) { |
|
96 | 96 | return new FileSystemLoader($serviceManager->get('templating.locator')); |
97 | 97 | }); |
98 | 98 | |
99 | 99 | /* |
100 | 100 | * Templating assets helper. |
101 | 101 | */ |
102 | - $serviceManager->setFactory('templating.helper.assets', function ($serviceManager) { |
|
102 | + $serviceManager->setFactory('templating.helper.assets', function($serviceManager) { |
|
103 | 103 | return new AssetsHelper($serviceManager->get('request')->getBasePath()); |
104 | 104 | }); |
105 | 105 | |
106 | 106 | /* |
107 | 107 | * Templating globals. |
108 | 108 | */ |
109 | - $serviceManager->setFactory('templating.globals', function ($serviceManager) { |
|
109 | + $serviceManager->setFactory('templating.globals', function($serviceManager) { |
|
110 | 110 | return new GlobalVariables($serviceManager->get('servicemanager')); |
111 | 111 | }); |
112 | 112 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * |
116 | 116 | * TODO: Migrate to Symfony\Bundle\FrameworkBundle\Templating\PhpEngine |
117 | 117 | */ |
118 | - $serviceManager->setFactory('templating.engine.php', function ($serviceManager) use ($appCharset) { |
|
118 | + $serviceManager->setFactory('templating.engine.php', function($serviceManager) use ($appCharset) { |
|
119 | 119 | $engine = new PhpEngine( |
120 | 120 | $serviceManager->get('templating.name_parser'), |
121 | 121 | $serviceManager->get('templating.loader'), |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /* |
137 | 137 | * Twig Engine |
138 | 138 | */ |
139 | - $serviceManager->setFactory('templating.engine.twig', function ($serviceManager) { |
|
139 | + $serviceManager->setFactory('templating.engine.twig', function($serviceManager) { |
|
140 | 140 | |
141 | 141 | if (!class_exists('Twig_Environment')) { |
142 | 142 | throw new \Exception('PPI\Framework\TwigModule not found. Composer require: ppi/twig-module'); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | /* |
160 | 160 | * Smarty Engine. |
161 | 161 | */ |
162 | - $serviceManager->setFactory('templating.engine.smarty', function ($serviceManager) use ($appCacheDir) { |
|
162 | + $serviceManager->setFactory('templating.engine.smarty', function($serviceManager) use ($appCacheDir) { |
|
163 | 163 | |
164 | 164 | if (!class_exists('NoiseLabs\Bundle\SmartyBundle\SmartyEngine')) { |
165 | 165 | throw new \Exception('PPI\Framework\SmartyModule not found. Composer require: ppi/smarty-module'); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | }); |
189 | 189 | |
190 | 190 | // Mustache Engine |
191 | - $serviceManager->setFactory('templating.engine.mustache', function ($serviceManager, $appCacheDir) { |
|
191 | + $serviceManager->setFactory('templating.engine.mustache', function($serviceManager, $appCacheDir) { |
|
192 | 192 | |
193 | 193 | if (!class_exists('Mustache_Engine')) { |
194 | 194 | throw new \Exception('PPI\Framework\MustacheModule not found. Composer require: ppi/mustache-module'); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | /* |
207 | 207 | * Delegating Engine. |
208 | 208 | */ |
209 | - $serviceManager->setFactory('templating.engine.delegating', function ($serviceManager) use ($engineIds) { |
|
209 | + $serviceManager->setFactory('templating.engine.delegating', function($serviceManager) use ($engineIds) { |
|
210 | 210 | $delegatingEngine = new DelegatingEngine(); |
211 | 211 | // @todo - lazy load this |
212 | 212 | foreach ($engineIds as $id) { |
@@ -14,16 +14,13 @@ |
||
14 | 14 | use PPI\Framework\Router\ChainRouter; |
15 | 15 | use Zend\ServiceManager\FactoryInterface; |
16 | 16 | use Zend\ServiceManager\ServiceLocatorInterface; |
17 | - |
|
18 | 17 | use PPI\Framework\Router\Router as SymfonyRouter; |
19 | 18 | use PPI\Framework\Router\Wrapper\SymfonyRouterWrapper; |
20 | 19 | use Symfony\Component\Routing\RouteCollection as SymfonyRouteCollection; |
21 | - |
|
22 | 20 | use Illuminate\Http\Request as LaravelRequest; |
23 | 21 | use Illuminate\Routing\Router as LaravelRouter; |
24 | 22 | use Illuminate\Routing\UrlGenerator as LaravelUrlGenerator; |
25 | 23 | use PPI\LaravelRouting\Wrapper\LaravelRouterWrapper; |
26 | - |
|
27 | 24 | use Aura\Router\Router as AuraRouter; |
28 | 25 | use PPI\Framework\Router\Wrapper\AuraRouterWrapper; |
29 | 26 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | // For each module, add a matching instance type to the chain router |
58 | 58 | foreach ($allModuleRoutes as $moduleName => $moduleRoutingResponse) { |
59 | 59 | |
60 | - switch(true) { |
|
60 | + switch (true) { |
|
61 | 61 | // @todo - move this to a separate method() |
62 | 62 | case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
63 | 63 | $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2015 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * |
|
8 | - * @link http://www.ppi.io |
|
9 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2015 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * |
|
8 | + * @link http://www.ppi.io |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace PPI\Framework\ServiceManager; |
12 | 12 |
@@ -60,37 +60,37 @@ |
||
60 | 60 | |
61 | 61 | switch(true) { |
62 | 62 | // @todo - move this to a separate method() |
63 | - case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
64 | - $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
65 | - $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
66 | - $chainRouter->add($sfRouterWrapper); |
|
67 | - break; |
|
68 | - |
|
69 | - // @todo - move this to a separate method() |
|
70 | - case $moduleRoutingResponse instanceof AuraRouter: |
|
71 | - $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
72 | - $chainRouter->add($auraRouterWrapper); |
|
73 | - break; |
|
74 | - |
|
75 | - // @todo - move this to a separate method() |
|
76 | - case $moduleRoutingResponse instanceof LaravelRouter: |
|
77 | - $laravelRequest = new LaravelRequest(); |
|
78 | - $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
79 | - $laravelRouterWrapper = new LaravelRouterWrapper( |
|
80 | - $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
81 | - ); |
|
82 | - // @todo - solve this problem |
|
63 | + case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
64 | + $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
65 | + $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
66 | + $chainRouter->add($sfRouterWrapper); |
|
67 | + break; |
|
68 | + |
|
69 | + // @todo - move this to a separate method() |
|
70 | + case $moduleRoutingResponse instanceof AuraRouter: |
|
71 | + $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
72 | + $chainRouter->add($auraRouterWrapper); |
|
73 | + break; |
|
74 | + |
|
75 | + // @todo - move this to a separate method() |
|
76 | + case $moduleRoutingResponse instanceof LaravelRouter: |
|
77 | + $laravelRequest = new LaravelRequest(); |
|
78 | + $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
79 | + $laravelRouterWrapper = new LaravelRouterWrapper( |
|
80 | + $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
81 | + ); |
|
82 | + // @todo - solve this problem |
|
83 | 83 | // $laravelRouterWrapper->setModuleName($this->getName()); |
84 | - $chainRouter->add($laravelRouterWrapper); |
|
85 | - break; |
|
84 | + $chainRouter->add($laravelRouterWrapper); |
|
85 | + break; |
|
86 | 86 | |
87 | - case $moduleRoutingResponse instanceof FastRouteWrapper: |
|
88 | - $chainRouter->add($moduleRoutingResponse); |
|
89 | - break; |
|
87 | + case $moduleRoutingResponse instanceof FastRouteWrapper: |
|
88 | + $chainRouter->add($moduleRoutingResponse); |
|
89 | + break; |
|
90 | 90 | |
91 | - default: |
|
92 | - throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
93 | - '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
91 | + default: |
|
92 | + throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
93 | + '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 |
@@ -11,7 +11,6 @@ |
||
11 | 11 | namespace PPI\Framework\ServiceManager\Factory; |
12 | 12 | |
13 | 13 | use PPI\Framework\Router\RouterListener; |
14 | -use Symfony\Component\Routing\RequestContext; |
|
15 | 14 | use Zend\ServiceManager\FactoryInterface; |
16 | 15 | use Zend\ServiceManager\ServiceLocatorInterface; |
17 | 16 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * |
|
8 | - * @link http://www.ppi.io |
|
9 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * |
|
8 | + * @link http://www.ppi.io |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace PPI\Framework\ServiceManager; |
12 | 12 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @param ServiceLocatorInterface $serviceLocator |
27 | 27 | * |
28 | - * @return \PPI\Framework\Router\RouterListener |
|
28 | + * @return RequestContext |
|
29 | 29 | */ |
30 | 30 | public function createService(ServiceLocatorInterface $serviceLocator) |
31 | 31 | { |
@@ -61,7 +61,6 @@ |
||
61 | 61 | $defaults = $defaults['framework']['router']; |
62 | 62 | |
63 | 63 | return isset($config['framework']['router']) ? |
64 | - $this->mergeConfiguration($defaults, $config['framework']['router']) : |
|
65 | - $defaults; |
|
64 | + $this->mergeConfiguration($defaults, $config['framework']['router']) : $defaults; |
|
66 | 65 | } |
67 | 66 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * |
|
8 | - * @link http://www.ppi.io |
|
9 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * |
|
8 | + * @link http://www.ppi.io |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace PPI\Framework\ServiceManager; |
12 | 12 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | /** |
71 | 71 | * Renders a template. |
72 | 72 | * |
73 | - * @param mixed $name A template name |
|
73 | + * @param string $name A template name |
|
74 | 74 | * @param array $parameters An array of parameters to pass to the template |
75 | 75 | * |
76 | 76 | * @throws \InvalidArgumentException if the template does not exist |
@@ -112,7 +112,7 @@ |
||
112 | 112 | $moduleCreateCommand->setTargetModuleDir($config['module_listener_options']['module_paths'][0]); |
113 | 113 | |
114 | 114 | // Enabled templating engines |
115 | - if(isset($config['framework']['templating']['engines'])) { |
|
115 | + if (isset($config['framework']['templating']['engines'])) { |
|
116 | 116 | $moduleCreateCommand->setEnabledTemplatingEngines($config['framework']['templating']['engines']); |
117 | 117 | } |
118 | 118 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | - * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | - * |
|
8 | - * @link http://www.ppi.io |
|
9 | - */ |
|
3 | + * This file is part of the PPI Framework. |
|
4 | + * |
|
5 | + * @copyright Copyright (c) 2011-2013 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * |
|
8 | + * @link http://www.ppi.io |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace PPI\Framework\View; |
12 | 12 |
@@ -124,7 +124,7 @@ |
||
124 | 124 | $output->write(sprintf('<info>%s</info> ', str_pad($id, $pad['id']))); |
125 | 125 | $output->write(sprintf('%s ', str_pad($line['type'], $pad['type']))); |
126 | 126 | if ('Alias' == $line['type']) { |
127 | - $output->write(sprintf('<comment>alias for</comment> <info>%s </info>', str_pad($line['class'], $pad['class']-10))); |
|
127 | + $output->write(sprintf('<comment>alias for</comment> <info>%s </info>', str_pad($line['class'], $pad['class'] - 10))); |
|
128 | 128 | } else { |
129 | 129 | $output->write(sprintf('%s ', str_pad($line['class'], $pad['class']))); |
130 | 130 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $parameters = parent::matchRequest($request); |
71 | 71 | $this->matchedRouteRequest = $request; |
72 | 72 | return $parameters; |
73 | - } catch(\Exception $e) { |
|
73 | + } catch (\Exception $e) { |
|
74 | 74 | throw $e; |
75 | 75 | } |
76 | 76 | } |