@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * Get required modules for Yawik |
| 61 | 61 | * |
| 62 | - * @return array |
|
| 62 | + * @return string[] |
|
| 63 | 63 | */ |
| 64 | 64 | public static function getRequiredModules() |
| 65 | 65 | { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * Setup php server |
| 196 | - * @return bool |
|
| 196 | + * @return null|boolean |
|
| 197 | 197 | * @codeCoverageIgnore |
| 198 | 198 | */ |
| 199 | 199 | public static function setupCliServerEnv() |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @param array $loadModules |
| 93 | 93 | * @return array |
| 94 | 94 | */ |
| 95 | - public static function generateModuleConfiguration($loadModules=[]) |
|
| 95 | + public static function generateModuleConfiguration($loadModules = []) |
|
| 96 | 96 | { |
| 97 | 97 | $modules = array_merge( |
| 98 | 98 | static::getRequiredModules(), |
@@ -173,12 +173,12 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | $modules = []; |
| 175 | 175 | $configDir = static::getConfigDir(); |
| 176 | - foreach (glob($configDir. '/autoload/*.module.php') as $moduleFile) { |
|
| 176 | + foreach (glob($configDir.'/autoload/*.module.php') as $moduleFile) { |
|
| 177 | 177 | $addModules = require $moduleFile; |
| 178 | 178 | foreach ($addModules as $addModule) { |
| 179 | 179 | if (strpos($addModule, '-') === 0) { |
| 180 | 180 | $remove = substr($addModule, 1); |
| 181 | - $modules = array_filter($modules, function ($elem) use ($remove) { |
|
| 181 | + $modules = array_filter($modules, function($elem) use ($remove) { |
|
| 182 | 182 | return strcasecmp($elem, $remove); |
| 183 | 183 | }); |
| 184 | 184 | } else { |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | public static function setupCliServerEnv() |
| 200 | 200 | { |
| 201 | 201 | $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1)); |
| 202 | - $route = isset($parseUrl['path']) ? $parseUrl['path']:null; |
|
| 203 | - if (is_file(__DIR__ . '/' . $route)) { |
|
| 202 | + $route = isset($parseUrl['path']) ? $parseUrl['path'] : null; |
|
| 203 | + if (is_file(__DIR__.'/'.$route)) { |
|
| 204 | 204 | if (substr($route, -4) == ".php") { |
| 205 | - require __DIR__ . '/' . $route; // Include requested script files |
|
| 205 | + require __DIR__.'/'.$route; // Include requested script files |
|
| 206 | 206 | exit; |
| 207 | 207 | } |
| 208 | - return false; // Serve file as is |
|
| 208 | + return false; // Serve file as is |
|
| 209 | 209 | } else { // Fallback to index.php |
| 210 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
| 210 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
| 211 | 211 | } |
| 212 | 212 | return true; |
| 213 | 213 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public static function loadDotEnv() |
| 219 | 219 | { |
| 220 | - static $isLoaded=false; |
|
| 220 | + static $isLoaded = false; |
|
| 221 | 221 | if ($isLoaded) { |
| 222 | 222 | return; |
| 223 | 223 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | // setup docker environment |
| 332 | - if (getenv('DOCKER_ENV')=='yes') { |
|
| 332 | + if (getenv('DOCKER_ENV') == 'yes') { |
|
| 333 | 333 | $configuration = ArrayUtils::merge($configuration, static::getDockerEnv($configuration)); |
| 334 | 334 | } |
| 335 | 335 | return $configuration; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function getConfig() |
| 29 | 29 | { |
| 30 | - return ModuleConfigLoader::load(__DIR__ . '/../config'); |
|
| 30 | + return ModuleConfigLoader::load(__DIR__.'/../config'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $createJobListener->attachShared($sharedManager); |
| 42 | 42 | |
| 43 | 43 | if ($e->getRequest() instanceof \Zend\Http\Request) { |
| 44 | - $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $event) { |
|
| 44 | + $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function(MvcEvent $event) { |
|
| 45 | 45 | $serviceManager = $event->getApplication() |
| 46 | 46 | ->getServiceManager(); |
| 47 | 47 | $options = $serviceManager->get('Organizations/ImageFileCacheOptions'); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | private $config; |
| 31 | 31 | |
| 32 | - public function __construct($config=null) |
|
| 32 | + public function __construct($config = null) |
|
| 33 | 33 | { |
| 34 | 34 | umask(0000); |
| 35 | 35 | if (is_null($config)) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public function iSetMainWindowName() |
| 180 | 180 | { |
| 181 | 181 | $window_name = 'main_window'; |
| 182 | - $script = 'window.name = "' . $window_name . '"'; |
|
| 182 | + $script = 'window.name = "'.$window_name.'"'; |
|
| 183 | 183 | $this->getSession()->executeScript($script); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -238,14 +238,14 @@ discard block |
||
| 238 | 238 | break; |
| 239 | 239 | |
| 240 | 240 | default: |
| 241 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
| 241 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
| 242 | 242 | break; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | try { |
| 246 | 246 | $this->getSession()->executeScript($function); |
| 247 | 247 | } catch (\Exception $e) { |
| 248 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
| 248 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * |
| 266 | 266 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
| 267 | 267 | */ |
| 268 | - public function getElement($locator, $selector='css') |
|
| 268 | + public function getElement($locator, $selector = 'css') |
|
| 269 | 269 | { |
| 270 | 270 | $page = $this->minkContext->getSession()->getPage(); |
| 271 | 271 | $element = $page->find('css', $locator); |
@@ -299,12 +299,12 @@ discard block |
||
| 299 | 299 | $session = $this->getSession(); |
| 300 | 300 | $element = $session->getPage()->find( |
| 301 | 301 | 'xpath', |
| 302 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
| 302 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]') |
|
| 303 | 303 | ); |
| 304 | 304 | if (null === $element) { |
| 305 | 305 | $element = $session->getPage()->find( |
| 306 | 306 | 'named', |
| 307 | - array('id',$text) |
|
| 307 | + array('id', $text) |
|
| 308 | 308 | ); |
| 309 | 309 | } |
| 310 | 310 | if (null === $element) { |