@@ -104,7 +104,6 @@ discard block |
||
104 | 104 | |
105 | 105 | /** |
106 | 106 | * @param $name |
107 | - * @param array $params |
|
108 | 107 | * |
109 | 108 | * @return string |
110 | 109 | */ |
@@ -115,6 +114,7 @@ discard block |
||
115 | 114 | |
116 | 115 | /** |
117 | 116 | * @When /^I hover over the element "([^"]*)"$/ |
117 | + * @param string $locator |
|
118 | 118 | */ |
119 | 119 | public function iHoverOverTheElement($locator) |
120 | 120 | { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
262 | - * @param $locator |
|
262 | + * @param string $locator |
|
263 | 263 | * @param string $selector |
264 | 264 | * |
265 | 265 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * Get required modules for Yawik |
38 | 38 | * |
39 | - * @return array |
|
39 | + * @return string[] |
|
40 | 40 | */ |
41 | 41 | public static function getRequiredModules() |
42 | 42 | { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | /** |
174 | 174 | * Setup php server |
175 | - * @return bool |
|
175 | + * @return null|boolean |
|
176 | 176 | * @codeCoverageIgnore |
177 | 177 | */ |
178 | 178 | private static function setupCliServerEnv() |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $loadModules |
70 | 70 | * @return array |
71 | 71 | */ |
72 | - public static function generateModuleConfiguration($loadModules=[]) |
|
72 | + public static function generateModuleConfiguration($loadModules = []) |
|
73 | 73 | { |
74 | 74 | $modules = ArrayUtils::merge( |
75 | 75 | static::getRequiredModules(), |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | { |
153 | 153 | $modules = []; |
154 | 154 | $configDir = static::getConfigDir(); |
155 | - foreach (glob($configDir. '/autoload/*.module.php') as $moduleFile) { |
|
155 | + foreach (glob($configDir.'/autoload/*.module.php') as $moduleFile) { |
|
156 | 156 | $addModules = require $moduleFile; |
157 | 157 | foreach ($addModules as $addModule) { |
158 | 158 | if (strpos($addModule, '-') === 0) { |
159 | 159 | $remove = substr($addModule, 1); |
160 | - $modules = array_filter($modules, function ($elem) use ($remove) { |
|
160 | + $modules = array_filter($modules, function($elem) use ($remove) { |
|
161 | 161 | return strcasecmp($elem, $remove); |
162 | 162 | }); |
163 | 163 | } else { |
@@ -178,15 +178,15 @@ discard block |
||
178 | 178 | private static function setupCliServerEnv() |
179 | 179 | { |
180 | 180 | $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1)); |
181 | - $route = isset($parseUrl['path']) ? $parseUrl['path']:null; |
|
182 | - if (is_file(__DIR__ . '/' . $route)) { |
|
181 | + $route = isset($parseUrl['path']) ? $parseUrl['path'] : null; |
|
182 | + if (is_file(__DIR__.'/'.$route)) { |
|
183 | 183 | if (substr($route, -4) == ".php") { |
184 | - require __DIR__ . '/' . $route; // Include requested script files |
|
184 | + require __DIR__.'/'.$route; // Include requested script files |
|
185 | 185 | exit; |
186 | 186 | } |
187 | - return false; // Serve file as is |
|
187 | + return false; // Serve file as is |
|
188 | 188 | } else { // Fallback to index.php |
189 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
189 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
190 | 190 | } |
191 | 191 | return true; |
192 | 192 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public static function loadDotEnv() |
198 | 198 | { |
199 | - static $isLoaded=false; |
|
199 | + static $isLoaded = false; |
|
200 | 200 | if ($isLoaded) { |
201 | 201 | return; |
202 | 202 | } |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | //@TODO: should move this version loading to somewhere else |
214 | - $isVendor = strpos(__FILE__, 'modules')!==false || strpos(__FILE__, 'vendor') !== false; |
|
215 | - $version = getenv('TRAVIS') || $isVendor ? "undefined":exec('git describe'); |
|
216 | - $branch = getenv('TRAVIS') || $isVendor ? "undefined":exec('git rev-parse --abbrev-ref HEAD', $output, $retVal); |
|
214 | + $isVendor = strpos(__FILE__, 'modules') !== false || strpos(__FILE__, 'vendor') !== false; |
|
215 | + $version = getenv('TRAVIS') || $isVendor ? "undefined" : exec('git describe'); |
|
216 | + $branch = getenv('TRAVIS') || $isVendor ? "undefined" : exec('git rev-parse --abbrev-ref HEAD', $output, $retVal); |
|
217 | 217 | static::$VERSION = $version.'['.$branch.']'; |
218 | 218 | |
219 | 219 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * Get required modules for Yawik |
46 | 46 | * |
47 | - * @return array |
|
47 | + * @return string[] |
|
48 | 48 | */ |
49 | 49 | public static function getRequiredModules() |
50 | 50 | { |
@@ -89,7 +89,6 @@ discard block |
||
89 | 89 | * Run application |
90 | 90 | * @param mixed|array $appConfig |
91 | 91 | * |
92 | - * @param bool $run |
|
93 | 92 | * @return bool|ZendApplication |
94 | 93 | */ |
95 | 94 | public static function initApplication($appConfig = null) |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | $dotenv = new Dotenv(); |
36 | 36 | $dotenv->load($env); |
37 | 37 | } |
38 | - $isVendor = strpos(__FILE__, 'modules')!==false || strpos(__FILE__, 'vendor') !== false; |
|
39 | - $version = getenv('TRAVIS') || $isVendor ? "undefined":exec('git describe'); |
|
40 | - $branch = getenv('TRAVIS') || $isVendor ? "undefined":exec('git rev-parse --abbrev-ref HEAD', $output, $retVal); |
|
38 | + $isVendor = strpos(__FILE__, 'modules') !== false || strpos(__FILE__, 'vendor') !== false; |
|
39 | + $version = getenv('TRAVIS') || $isVendor ? "undefined" : exec('git describe'); |
|
40 | + $branch = getenv('TRAVIS') || $isVendor ? "undefined" : exec('git rev-parse --abbrev-ref HEAD', $output, $retVal); |
|
41 | 41 | static::$VERSION = $version.'['.$branch.']'; |
42 | 42 | } |
43 | 43 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param array $loadModules |
78 | 78 | * @return array |
79 | 79 | */ |
80 | - public static function generateModuleConfiguration($loadModules=[]) |
|
80 | + public static function generateModuleConfiguration($loadModules = []) |
|
81 | 81 | { |
82 | 82 | return ArrayUtils::merge( |
83 | 83 | static::getRequiredModules(), |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $file = null; |
105 | 105 | if (is_file($test = getcwd().'/test/config/config.php')) { |
106 | 106 | $file = $test; |
107 | - } elseif (is_file($test = getcwd(). '/config/config.php')) { |
|
107 | + } elseif (is_file($test = getcwd().'/config/config.php')) { |
|
108 | 108 | $file = $test; |
109 | 109 | } elseif (is_file($test = __DIR__.'/../config/config.php')) { |
110 | 110 | $file = $test; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | return ZendApplication::init($appConfig); |
129 | 129 | } |
130 | 130 | |
131 | - public static function runApplication($appConfig=null) |
|
131 | + public static function runApplication($appConfig = null) |
|
132 | 132 | { |
133 | 133 | ini_set('display_errors', true); |
134 | 134 | ini_set('error_reporting', E_ALL | E_STRICT); |
@@ -143,15 +143,15 @@ discard block |
||
143 | 143 | |
144 | 144 | if (php_sapi_name() == 'cli-server') { |
145 | 145 | $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1)); |
146 | - $route = isset($parseUrl['path']) ? $parseUrl['path']:null; |
|
147 | - if (is_file(__DIR__ . '/' . $route)) { |
|
146 | + $route = isset($parseUrl['path']) ? $parseUrl['path'] : null; |
|
147 | + if (is_file(__DIR__.'/'.$route)) { |
|
148 | 148 | if (substr($route, -4) == ".php") { |
149 | - require __DIR__ . '/' . $route; // Include requested script files |
|
149 | + require __DIR__.'/'.$route; // Include requested script files |
|
150 | 150 | exit; |
151 | 151 | } |
152 | - return false; // Serve file as is |
|
152 | + return false; // Serve file as is |
|
153 | 153 | } else { // Fallback to index.php |
154 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
154 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $parameter_instances[] = $container->get($cn); |
55 | 55 | } catch (\Exception $x) { |
56 | 56 | echo __CLASS__ |
57 | - . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
57 | + . " couldn't create an instance of $cn to satisfy the constructor for $requestedName."; |
|
58 | 58 | exit; |
59 | 59 | } |
60 | 60 | } else { |
@@ -33,8 +33,8 @@ |
||
33 | 33 | |
34 | 34 | public function canCreate(ContainerInterface $container, $requestedName) |
35 | 35 | { |
36 | - list($module, ) = explode('\\', __NAMESPACE__, 2); |
|
37 | - return strstr($requestedName, $module . '\Controller') !== false; |
|
36 | + list($module,) = explode('\\', __NAMESPACE__, 2); |
|
37 | + return strstr($requestedName, $module.'\Controller') !== false; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
@@ -61,8 +61,8 @@ |
||
61 | 61 | $routeMatch->setParam('action', $p); |
62 | 62 | $response = $this->getResponse(); |
63 | 63 | $response->getHeaders() |
64 | - ->addHeaderLine('Content-Type', 'application/json') |
|
65 | - ->addHeaderLine('Content-Encoding', 'utf8'); |
|
64 | + ->addHeaderLine('Content-Type', 'application/json') |
|
65 | + ->addHeaderLine('Content-Encoding', 'utf8'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | parent::attachDefaultListeners(); |
163 | 163 | |
164 | 164 | $events = $this->getEventManager(); |
165 | - $events->attach(MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100); |
|
165 | + $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | public function __construct() |
31 | 31 | { |
32 | - static::$yawikGlobalConfig = getcwd() . '/config/autoload/yawik.config.global.php'; |
|
32 | + static::$yawikGlobalConfig = getcwd().'/config/autoload/yawik.config.global.php'; |
|
33 | 33 | static::$yawikBackupConfig = str_replace('yawik.config.global.php', 'yawik.backup', static::$yawikGlobalConfig); |
34 | 34 | } |
35 | 35 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use Zend\I18n\Translator\Resources; |
26 | 26 | use Zend\Mvc\MvcEvent; |
27 | 27 | |
28 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
28 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
29 | 29 | |
30 | 30 | |
31 | 31 | return array( |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'doctrine' => $doctrineConfig, |
34 | 34 | |
35 | 35 | 'options' => [ |
36 | - 'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ], |
|
36 | + 'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'], |
|
37 | 37 | ], |
38 | 38 | |
39 | 39 | 'Core' => array( |
@@ -277,19 +277,19 @@ discard block |
||
277 | 277 | 'modules/Core/jsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory', |
278 | 278 | 'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory', |
279 | 279 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
280 | - 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'], |
|
281 | - 'DefaultListeners' => ['Core\Listener\DefaultListener','factory'], |
|
282 | - 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'], |
|
283 | - 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'], |
|
280 | + 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'], |
|
281 | + 'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'], |
|
282 | + 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'], |
|
283 | + 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'], |
|
284 | 284 | 'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory', |
285 | 285 | 'Core/Locale' => 'Core\I18n\LocaleFactory', |
286 | 286 | \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class, |
287 | 287 | \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class, |
288 | 288 | 'Imagine' => \Core\Factory\Service\ImagineFactory::class, |
289 | - 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'], |
|
290 | - 'Tracy' => [Tracy::class,'factory'], |
|
289 | + 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'], |
|
290 | + 'Tracy' => [Tracy::class, 'factory'], |
|
291 | 291 | Service\EntityEraser\DefaultEntityLoaderListener::class => Service\EntityEraser\DefaultEntityLoaderListenerFactory::class, |
292 | - ClearCacheService::class => [ClearCacheService::class,'factory'] |
|
292 | + ClearCacheService::class => [ClearCacheService::class, 'factory'] |
|
293 | 293 | ), |
294 | 294 | 'abstract_factories' => array( |
295 | 295 | 'Core\Factory\OptionsAbstractFactory', |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'translation_file_patterns' => array( |
313 | 313 | [ |
314 | 314 | 'type' => 'gettext', |
315 | - 'base_dir' => __DIR__ . '/../language', |
|
315 | + 'base_dir' => __DIR__.'/../language', |
|
316 | 316 | 'pattern' => '%s.mo', |
317 | 317 | ], |
318 | 318 | [ |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | 'Core/File' => FileControllerFactory::class, |
358 | 358 | 'Core/Content' => LazyControllerFactory::class, |
359 | 359 | Controller\Console\PurgeController::class => Controller\Console\PurgeControllerFactory::class, |
360 | - AssetsInstallController::class => [AssetsInstallController::class,'factory'], |
|
361 | - SubsplitController::class => [SubsplitController::class,'factory'], |
|
362 | - ClearCacheController::class => [ClearCacheController::class,'factory'], |
|
360 | + AssetsInstallController::class => [AssetsInstallController::class, 'factory'], |
|
361 | + SubsplitController::class => [SubsplitController::class, 'factory'], |
|
362 | + ClearCacheController::class => [ClearCacheController::class, 'factory'], |
|
363 | 363 | |
364 | 364 | ], |
365 | 365 | ), |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | 'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory', |
373 | 373 | 'listquery' => 'Core\Controller\Plugin\ListQuery::factory', |
374 | 374 | 'mail' => 'Core\Controller\Plugin\Mail::factory', |
375 | - 'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'], |
|
376 | - 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'], |
|
377 | - 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'], |
|
375 | + 'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'], |
|
376 | + 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'], |
|
377 | + 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'], |
|
378 | 378 | Controller\Plugin\EntityEraser::class => Controller\Plugin\EntityEraserFactory::class, |
379 | 379 | ), |
380 | 380 | 'invokables' => array( |
@@ -405,32 +405,32 @@ discard block |
||
405 | 405 | 'exception_template' => 'error/index', |
406 | 406 | // Map template to files. Speeds up the lookup through the template stack. |
407 | 407 | 'template_map' => array( |
408 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
409 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
410 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
411 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
412 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
413 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
414 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
415 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
416 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
417 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
418 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
419 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
420 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
421 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
422 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
423 | - 'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml', |
|
424 | - 'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml', |
|
425 | - 'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml', |
|
426 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
427 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
428 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
408 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
409 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
410 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
411 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
412 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
413 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
414 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
415 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
416 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
417 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
418 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
419 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
420 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
421 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
422 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
423 | + 'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml', |
|
424 | + 'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml', |
|
425 | + 'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml', |
|
426 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
427 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
428 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
429 | 429 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
430 | 430 | ), |
431 | 431 | // Where to look for view templates not mapped above |
432 | 432 | 'template_path_stack' => array( |
433 | - __DIR__ . '/../view', |
|
433 | + __DIR__.'/../view', |
|
434 | 434 | ), |
435 | 435 | ), |
436 | 436 | 'view_helpers' => array( |