@@ -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 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2012-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) 2012-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; |
12 | 12 |
@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -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 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) |
86 | 86 | { |
87 | 87 | $ret = $this->router->generate($name, $parameters); |
88 | - if($ret === false) { |
|
88 | + if ($ret === false) { |
|
89 | 89 | throw new RouteNotFoundException('Unable to generate route for: ' . $name); |
90 | 90 | } |
91 | 91 | return $ret; |
@@ -127,16 +127,16 @@ discard block |
||
127 | 127 | $routeParams = $matchedRoute->params; |
128 | 128 | |
129 | 129 | // The 'action' key always exists and defaults to the Route Name, so we check accordingly |
130 | - if(!isset($routeParams['controller']) && $routeParams['action'] === $matchedRoute->name) { |
|
130 | + if (!isset($routeParams['controller']) && $routeParams['action'] === $matchedRoute->name) { |
|
131 | 131 | throw new \Exception('Matched the route: ' . $matchedRoute->name . ' but unable to locate |
132 | 132 | any controller/action params to dispatch'); |
133 | 133 | } |
134 | 134 | |
135 | 135 | // We need _controller, to that symfony ControllerResolver can pick this up |
136 | - if(!isset($routeParams['_controller'])) { |
|
137 | - if(isset($routeParams['controller'])) { |
|
136 | + if (!isset($routeParams['_controller'])) { |
|
137 | + if (isset($routeParams['controller'])) { |
|
138 | 138 | $routeParams['_controller'] = $routeParams['controller']; |
139 | - } elseif(isset($routeParams['action'])) { |
|
139 | + } elseif (isset($routeParams['action'])) { |
|
140 | 140 | $routeParams['_controller'] = $routeParams['action']; |
141 | 141 | } else { |
142 | 142 | throw new \Exception('Unable to determine the controller from route: ' . $matchedRoute->name); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $routeParams['_route'] = $matchedRoute->name; |
147 | 147 | |
148 | 148 | // If the controller is an Object, and 'action' is defaulted to the route name - we default to __invoke |
149 | - if($routeParams['action'] === $matchedRoute->name) { |
|
149 | + if ($routeParams['action'] === $matchedRoute->name) { |
|
150 | 150 | $routeParams['action'] = '__invoke'; |
151 | 151 | } |
152 | 152 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $loggerClass = $configs['parameters']['monolog.logger.class']; |
84 | - $serviceManager->setFactory('monolog.logger', function ($serviceManager) use ($loggerClass, $handlersToChannels) { |
|
84 | + $serviceManager->setFactory('monolog.logger', function($serviceManager) use ($loggerClass, $handlersToChannels) { |
|
85 | 85 | $logger = new $loggerClass('app'); |
86 | 86 | foreach ($handlersToChannels as $handler => $channels) { |
87 | 87 | $logger->pushHandler($serviceManager->get($handler)); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $class = $parameters[sprintf('monolog.handler.%s.class', $handler['type'])]; |
106 | 106 | $handler['level'] = is_int($handler['level']) ? $handler['level'] : constant('Monolog\Logger::' . strtoupper($handler['level'])); |
107 | 107 | |
108 | - $serviceManager->setFactory($handlerId, function ($serviceManager) use ($class, $handler) { |
|
108 | + $serviceManager->setFactory($handlerId, function($serviceManager) use ($class, $handler) { |
|
109 | 109 | switch ($handler['type']) { |
110 | 110 | case 'stream': |
111 | 111 | return new $class($handler['path'], $handler['level'], $handler['bubble']); |
@@ -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 |