@@ -57,6 +57,10 @@ |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | + /** |
|
61 | + * @param string $src |
|
62 | + * @param string $dst |
|
63 | + */ |
|
60 | 64 | protected function copyRecursively($src, $dst) |
61 | 65 | { |
62 | 66 | $dir = opendir($src); |
@@ -27,9 +27,9 @@ |
||
27 | 27 | { |
28 | 28 | |
29 | 29 | $this->setName('module:create') |
30 | - ->setDescription('Create a module') |
|
31 | - ->addArgument('name', InputArgument::REQUIRED, 'What is your module name?') |
|
32 | - ->addOption('dir', null, InputOption::VALUE_NONE, 'Specify the modules directory'); |
|
30 | + ->setDescription('Create a module') |
|
31 | + ->addArgument('name', InputArgument::REQUIRED, 'What is your module name?') |
|
32 | + ->addOption('dir', null, InputOption::VALUE_NONE, 'Specify the modules directory'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -61,12 +61,12 @@ |
||
61 | 61 | { |
62 | 62 | $dir = opendir($src); |
63 | 63 | @mkdir($dst); |
64 | - while (false !== ( $file = readdir($dir)) ) { |
|
65 | - if (( $file != '.' ) && ( $file != '..' )) { |
|
66 | - if ( is_dir($src . '/' . $file) ) { |
|
67 | - $this->copyRecursively($src . '/' . $file,$dst . '/' . $file); |
|
64 | + while (false !== ($file = readdir($dir))) { |
|
65 | + if (($file != '.') && ($file != '..')) { |
|
66 | + if (is_dir($src . '/' . $file)) { |
|
67 | + $this->copyRecursively($src . '/' . $file, $dst . '/' . $file); |
|
68 | 68 | } else { |
69 | - copy($src . '/' . $file,$dst . '/' . $file); |
|
69 | + copy($src . '/' . $file, $dst . '/' . $file); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |
@@ -21,7 +21,6 @@ |
||
21 | 21 | /** |
22 | 22 | * Manufacturs datasource drivers. |
23 | 23 | * |
24 | - * @param string $key |
|
25 | 24 | * |
26 | 25 | * @return object |
27 | 26 | * |
@@ -8,8 +8,8 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\DataSource; |
10 | 10 | |
11 | -use Doctrine\DBAL\DriverManager, |
|
12 | - Doctrine\DBAL\Configuration; |
|
11 | +use Doctrine\DBAL\DriverManager; |
|
12 | +use Doctrine\DBAL\Configuration; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * PDO class |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param array $options |
39 | 39 | * |
40 | - * @return void |
|
40 | + * @return HandlerInterface |
|
41 | 41 | */ |
42 | 42 | public function __construct(array $options = array()) |
43 | 43 | { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * Get the log file path |
65 | 65 | * |
66 | - * @return mixed |
|
66 | + * @return string |
|
67 | 67 | */ |
68 | 68 | private function getLogFile() |
69 | 69 | { |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $e->getLine() |
91 | 91 | ); |
92 | 92 | |
93 | - if (file_put_contents($logFile, $logEntry , FILE_APPEND|LOCK_EX) > 0) { |
|
93 | + if (file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX) > 0) { |
|
94 | 94 | return array( |
95 | 95 | 'status' => true, |
96 | 96 | 'message' => 'Written to log file ' . $logFile |
@@ -458,7 +458,7 @@ |
||
458 | 458 | * Get an option from the controller. |
459 | 459 | * |
460 | 460 | * @param string $option The option name |
461 | - * @param null $default The default value if the option does not exist |
|
461 | + * @param string $default The default value if the option does not exist |
|
462 | 462 | * |
463 | 463 | * @return mixed |
464 | 464 | */ |
@@ -254,34 +254,34 @@ |
||
254 | 254 | { |
255 | 255 | switch ($key = strtolower($key)) { |
256 | 256 | |
257 | - case 'ajax': |
|
258 | - if (!isset($this->_isCache['ajax'])) { |
|
259 | - return $this->_isCache['ajax'] = $this->getService('request')->isXmlHttpRequest(); |
|
260 | - } |
|
261 | - |
|
262 | - return $this->_isCache['ajax']; |
|
263 | - |
|
264 | - case 'put': |
|
265 | - case 'delete': |
|
266 | - case 'post': |
|
267 | - case 'patch': |
|
268 | - if (!isset($this->_isCache['requestMethod'][$key])) { |
|
269 | - $this->_isCache['requestMethod'][$key] = $this->getService('request')->getMethod() === strtoupper($key); |
|
270 | - } |
|
271 | - |
|
272 | - return $this->_isCache['requestMethod'][$key]; |
|
273 | - |
|
274 | - case 'ssl': |
|
275 | - case 'https': |
|
276 | - case 'secure': |
|
277 | - if (!isset($this->_isCache['secure'])) { |
|
278 | - $this->_isCache['secure'] = $this->getService('request')->isSecure(); |
|
279 | - } |
|
280 | - |
|
281 | - return $this->_isCache['secure']; |
|
282 | - |
|
283 | - default: |
|
284 | - throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
257 | + case 'ajax': |
|
258 | + if (!isset($this->_isCache['ajax'])) { |
|
259 | + return $this->_isCache['ajax'] = $this->getService('request')->isXmlHttpRequest(); |
|
260 | + } |
|
261 | + |
|
262 | + return $this->_isCache['ajax']; |
|
263 | + |
|
264 | + case 'put': |
|
265 | + case 'delete': |
|
266 | + case 'post': |
|
267 | + case 'patch': |
|
268 | + if (!isset($this->_isCache['requestMethod'][$key])) { |
|
269 | + $this->_isCache['requestMethod'][$key] = $this->getService('request')->getMethod() === strtoupper($key); |
|
270 | + } |
|
271 | + |
|
272 | + return $this->_isCache['requestMethod'][$key]; |
|
273 | + |
|
274 | + case 'ssl': |
|
275 | + case 'https': |
|
276 | + case 'secure': |
|
277 | + if (!isset($this->_isCache['secure'])) { |
|
278 | + $this->_isCache['secure'] = $this->getService('request')->isSecure(); |
|
279 | + } |
|
280 | + |
|
281 | + return $this->_isCache['secure']; |
|
282 | + |
|
283 | + default: |
|
284 | + throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
285 | 285 | |
286 | 286 | } |
287 | 287 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2012 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) 2012 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * @link http://www.ppi.io |
|
8 | + */ |
|
9 | 9 | namespace PPI\Exception; |
10 | 10 | |
11 | 11 | /** |
@@ -8,15 +8,15 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\Module\Listener; |
10 | 10 | |
11 | -use PPI\ServiceManager\ServiceManager, |
|
12 | - Zend\EventManager\EventManagerInterface, |
|
13 | - Zend\Loader\ModuleAutoloader, |
|
14 | - Zend\ModuleManager\Listener\AutoloaderListener, |
|
15 | - Zend\ModuleManager\Listener\DefaultListenerAggregate as ZendDefaultListenerAggregate, |
|
16 | - Zend\ModuleManager\Listener\InitTrigger, |
|
17 | - Zend\ModuleManager\Listener\ModuleResolverListener, |
|
18 | - Zend\ModuleManager\ModuleEvent, |
|
19 | - Zend\Stdlib\ArrayUtils; |
|
11 | +use PPI\ServiceManager\ServiceManager; |
|
12 | +use Zend\EventManager\EventManagerInterface; |
|
13 | +use Zend\Loader\ModuleAutoloader; |
|
14 | +use Zend\ModuleManager\Listener\AutoloaderListener; |
|
15 | +use Zend\ModuleManager\Listener\DefaultListenerAggregate as ZendDefaultListenerAggregate; |
|
16 | +use Zend\ModuleManager\Listener\InitTrigger; |
|
17 | +use Zend\ModuleManager\Listener\ModuleResolverListener; |
|
18 | +use Zend\ModuleManager\ModuleEvent; |
|
19 | +use Zend\Stdlib\ArrayUtils; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * DefaultListenerAggregate class |
@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\Module; |
10 | 10 | |
11 | -use PPI\Module\Routing\Loader\YamlFileLoader, |
|
12 | - Symfony\Component\Config\FileLocator, |
|
13 | - Symfony\Component\Yaml\Yaml as YamlParser; |
|
11 | +use PPI\Module\Routing\Loader\YamlFileLoader; |
|
12 | +use Symfony\Component\Config\FileLocator; |
|
13 | +use Symfony\Component\Yaml\Yaml as YamlParser; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * The base PPI module class.. |
@@ -224,7 +224,7 @@ |
||
224 | 224 | { |
225 | 225 | if (!method_exists($this->_controller, $this->_actionName)) { |
226 | 226 | throw new \Exception(sprintf( |
227 | - 'Unable to dispatch action: "%s" does not exist in controller '. |
|
227 | + 'Unable to dispatch action: "%s" does not exist in controller ' . |
|
228 | 228 | '"%s" within module "%s"', |
229 | 229 | $this->_actionName, |
230 | 230 | $this->_controllerName, |
@@ -8,8 +8,8 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\Module\Routing\Loader; |
10 | 10 | |
11 | -use Symfony\Component\Routing\Loader\YamlFileLoader as BaseYamlFileLoader, |
|
12 | - Symfony\Component\Routing\RouteCollection; |
|
11 | +use Symfony\Component\Routing\Loader\YamlFileLoader as BaseYamlFileLoader; |
|
12 | +use Symfony\Component\Routing\RouteCollection; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * YamlFileLoader class |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of the PPI Framework. |
|
4 | - * |
|
5 | - * @copyright Copyright (c) 2012 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) 2012 Paul Dragoonis <[email protected]> |
|
6 | + * @license http://opensource.org/licenses/mit-license.php MIT |
|
7 | + * @link http://www.ppi.io |
|
8 | + */ |
|
9 | 9 | namespace PPI\Exception; |
10 | 10 | |
11 | 11 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * Constructor. |
25 | 25 | * |
26 | 26 | * @param RequestContext $requestContext |
27 | - * @param type $collection |
|
27 | + * @param \Symfony\Component\Routing\RouteCollection $collection |
|
28 | 28 | * @param array $options |
29 | 29 | * |
30 | 30 | * @return void |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * Set the route collection |
43 | 43 | * |
44 | - * @param type $collection |
|
44 | + * @param \Symfony\Component\Routing\RouteCollection $collection |
|
45 | 45 | * |
46 | 46 | * @return void |
47 | 47 | */ |
@@ -8,8 +8,8 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\Module\Routing; |
10 | 10 | |
11 | -use Symfony\Component\Routing\Router as BaseRouter, |
|
12 | - Symfony\Component\Routing\RequestContext; |
|
11 | +use Symfony\Component\Routing\Router as BaseRouter; |
|
12 | +use Symfony\Component\Routing\RequestContext; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The PPI router |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | public function isMatcherCached() |
59 | 59 | { |
60 | 60 | return file_exists( |
61 | - $this->options['cache_dir']. |
|
62 | - DIRECTORY_SEPARATOR. |
|
63 | - $this->options['matcher_cache_class']. |
|
61 | + $this->options['cache_dir'] . |
|
62 | + DIRECTORY_SEPARATOR . |
|
63 | + $this->options['matcher_cache_class'] . |
|
64 | 64 | '.php' |
65 | 65 | ); |
66 | 66 | } |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | public function isGeneratorCached() |
74 | 74 | { |
75 | 75 | return file_exists( |
76 | - $this->options['cache_dir']. |
|
77 | - DIRECTORY_SEPARATOR. |
|
78 | - $this->options['generator_cache_class']. |
|
76 | + $this->options['cache_dir'] . |
|
77 | + DIRECTORY_SEPARATOR . |
|
78 | + $this->options['generator_cache_class'] . |
|
79 | 79 | '.php' |
80 | 80 | ); |
81 | 81 | } |