@@ -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 | if (is_null($config)) { |
35 | 35 | $config = __DIR__.'/../../../config/config.php'; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function iSetMainWindowName() |
181 | 181 | { |
182 | 182 | $window_name = 'main_window'; |
183 | - $script = 'window.name = "' . $window_name . '"'; |
|
183 | + $script = 'window.name = "'.$window_name.'"'; |
|
184 | 184 | $this->getSession()->executeScript($script); |
185 | 185 | } |
186 | 186 | |
@@ -239,14 +239,14 @@ discard block |
||
239 | 239 | break; |
240 | 240 | |
241 | 241 | default: |
242 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
242 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
243 | 243 | break; |
244 | 244 | } |
245 | 245 | |
246 | 246 | try { |
247 | 247 | $this->getSession()->executeScript($function); |
248 | 248 | } catch (\Exception $e) { |
249 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
249 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * |
267 | 267 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
268 | 268 | */ |
269 | - public function getElement($locator, $selector='css') |
|
269 | + public function getElement($locator, $selector = 'css') |
|
270 | 270 | { |
271 | 271 | $page = $this->minkContext->getSession()->getPage(); |
272 | 272 | $element = $page->find('css', $locator); |
@@ -300,12 +300,12 @@ discard block |
||
300 | 300 | $session = $this->getSession(); |
301 | 301 | $element = $session->getPage()->find( |
302 | 302 | 'xpath', |
303 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
303 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]') |
|
304 | 304 | ); |
305 | 305 | if (null === $element) { |
306 | 306 | $element = $session->getPage()->find( |
307 | 307 | 'named', |
308 | - array('id',$text) |
|
308 | + array('id', $text) |
|
309 | 309 | ); |
310 | 310 | } |
311 | 311 | if (null === $element) { |
@@ -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 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected $currentUser; |
65 | 65 | |
66 | - public function __construct($parameters=[]) |
|
66 | + public function __construct($parameters = []) |
|
67 | 67 | { |
68 | 68 | $defaultLoginInfo = [ |
69 | 69 | 'facebook' => [ |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD') |
76 | 76 | ], |
77 | 77 | ]; |
78 | - $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[]; |
|
78 | + $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : []; |
|
79 | 79 | $this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig); |
80 | 80 | } |
81 | 81 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @Given I am logged in as a recruiter |
143 | 143 | * @Given I am logged in as a recruiter with :organization as organization |
144 | 144 | */ |
145 | - public function iAmLoggedInAsARecruiter($organization=null) |
|
145 | + public function iAmLoggedInAsARecruiter($organization = null) |
|
146 | 146 | { |
147 | 147 | $user = $this->thereIsAUserIdentifiedBy( |
148 | 148 | '[email protected]', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function iDonTHaveUser($login) |
175 | 175 | { |
176 | 176 | $repo = $this->getUserRepository(); |
177 | - $user=$repo->findByLogin($login); |
|
177 | + $user = $repo->findByLogin($login); |
|
178 | 178 | if ($user instanceof UserInterface) { |
179 | 179 | $repo->remove($user, true); |
180 | 180 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | private function startLogin(UserInterface $user, $password) |
223 | 223 | { |
224 | 224 | $currentUser = $this->currentUser; |
225 | - if (!is_object($currentUser) || $user->getId()!=$currentUser->getId()) { |
|
225 | + if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) { |
|
226 | 226 | $this->iWantToLogIn(); |
227 | 227 | $this->iSpecifyTheUsernameAs($user->getLogin()); |
228 | 228 | $this->iSpecifyThePasswordAs($password); |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | /** |
243 | 243 | * @Given there is a user :email identified by :password |
244 | 244 | */ |
245 | - public function thereIsAUserIdentifiedBy($email, $password, $role=User::ROLE_RECRUITER, $fullname="Test Recruiter", $organization=null) |
|
245 | + public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null) |
|
246 | 246 | { |
247 | 247 | $repo = $this->getUserRepository(); |
248 | - if (!is_object($user=$repo->findByEmail($email))) { |
|
248 | + if (!is_object($user = $repo->findByEmail($email))) { |
|
249 | 249 | $user = $this->createUser($email, $password, $role, $fullname, $organization); |
250 | 250 | } |
251 | 251 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * |
267 | 267 | * @return \Auth\Entity\UserInterface |
268 | 268 | */ |
269 | - public function createUser($email, $password, $role=User::ROLE_RECRUITER, $fullname="Test Recruiter") |
|
269 | + public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter") |
|
270 | 270 | { |
271 | 271 | /* @var Register $service */ |
272 | 272 | /* @var User $user */ |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $expFullName = explode(' ', $fullname); |
281 | 281 | $info = $user->getInfo(); |
282 | 282 | $info->setFirstName(array_shift($expFullName)); |
283 | - $info->setLastName(count($expFullName)>0 ? implode(' ', $expFullName):''); |
|
283 | + $info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : ''); |
|
284 | 284 | $info->setEmail($email); |
285 | 285 | $info->setEmailVerified(true); |
286 | 286 | $repo->store($user); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | /* @var $repoOrganization OrganizationRepository */ |
311 | 311 | $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
312 | 312 | $result = $repoOrganization->findByName($orgName); |
313 | - $organization = count($result) > 0 ? $result[0]:null; |
|
313 | + $organization = count($result) > 0 ? $result[0] : null; |
|
314 | 314 | if (!$organization instanceof Organization) { |
315 | 315 | $organization = new Organization(); |
316 | 316 | $organizationName = new OrganizationName($orgName); |
@@ -426,12 +426,12 @@ discard block |
||
426 | 426 | { |
427 | 427 | $repo = $this->getUserRepository(); |
428 | 428 | $data = $table->getRowsHash(); |
429 | - $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
430 | - $password = isset($data['password']) ? $data['password']:'test'; |
|
431 | - $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
432 | - $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
429 | + $email = isset($data['email']) ? $data['email'] : '[email protected]'; |
|
430 | + $password = isset($data['password']) ? $data['password'] : 'test'; |
|
431 | + $fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User'; |
|
432 | + $role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER; |
|
433 | 433 | |
434 | - if (!is_object($user=$repo->findByLogin($email))) { |
|
434 | + if (!is_object($user = $repo->findByLogin($email))) { |
|
435 | 435 | $user = $this->createUser($email, $password, $role, $fullname); |
436 | 436 | } |
437 | 437 | $this->currentUser = $user; |
@@ -219,6 +219,9 @@ |
||
219 | 219 | $this->startLogin($user, 'test'); |
220 | 220 | } |
221 | 221 | |
222 | + /** |
|
223 | + * @param string $password |
|
224 | + */ |
|
222 | 225 | private function startLogin(UserInterface $user, $password) |
223 | 226 | { |
224 | 227 | $currentUser = $this->currentUser; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'factories' => [ |
26 | 26 | 'mvctranslator' => \Zend\Mvc\I18n\TranslatorFactory::class, |
27 | 27 | 'FilterManager' => \Zend\Filter\FilterPluginManagerFactory::class, |
28 | - 'Tracy' => [\Core\Service\Tracy::class,'factory'], |
|
28 | + 'Tracy' => [\Core\Service\Tracy::class, 'factory'], |
|
29 | 29 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
30 | 30 | ], |
31 | 31 | 'abstract_factories' => [ |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | 'exception_template' => 'error/index', |
96 | 96 | // Map template to files. Speeds up the lookup through the template stack. |
97 | 97 | 'template_map' => [ |
98 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
99 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
98 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
99 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
100 | 100 | ], |
101 | 101 | // Where to look for view templates not mapped above |
102 | 102 | 'template_path_stack' => [ |
103 | - __DIR__ . '/../view', |
|
103 | + __DIR__.'/../view', |
|
104 | 104 | ], |
105 | 105 | ], |
106 | 106 | |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | 'translation_file_patterns' => [ |
115 | 115 | [ |
116 | 116 | 'type' => 'gettext', |
117 | - 'base_dir' => __DIR__ . '/../language', |
|
117 | + 'base_dir' => __DIR__.'/../language', |
|
118 | 118 | 'pattern' => '%s.mo', |
119 | 119 | 'text_domain' => 'Install', |
120 | 120 | ], |
121 | 121 | [ |
122 | 122 | 'type' => 'phparray', |
123 | - 'base_dir' => __DIR__ . '/../../Core/language', |
|
123 | + 'base_dir' => __DIR__.'/../../Core/language', |
|
124 | 124 | 'pattern' => 'Zend_Validate.%s.php', |
125 | 125 | 'text_domain' => 'default', |
126 | 126 | ], |
@@ -8,15 +8,15 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | return [ |
11 | - 'tracy' => [ |
|
12 | - 'enabled' => true, // flag whether to load tracy at all |
|
13 | - 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
|
14 | - 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
|
15 | - 'strict' => true, // bool = cause immediate death|int = matched against error severity |
|
16 | - 'log' => __DIR__.'/../../../var/log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
17 | - 'email' => null, // in production mode notifies the recipient |
|
18 | - 'email_snooze' => 900 // interval for sending email in seconds |
|
19 | - ], |
|
11 | + 'tracy' => [ |
|
12 | + 'enabled' => true, // flag whether to load tracy at all |
|
13 | + 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
|
14 | + 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
|
15 | + 'strict' => true, // bool = cause immediate death|int = matched against error severity |
|
16 | + 'log' => __DIR__.'/../../../var/log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
17 | + 'email' => null, // in production mode notifies the recipient |
|
18 | + 'email_snooze' => 900 // interval for sending email in seconds |
|
19 | + ], |
|
20 | 20 | |
21 | 21 | 'doctrine' => [ |
22 | 22 | 'driver' => [ |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | 'invokables' => [ |
36 | 36 | 'Install/Listener/LanguageSetter' => 'Install\Listener\LanguageSetter', |
37 | 37 | ], |
38 | - 'factories' => [ |
|
39 | - 'mvctranslator' => \Zend\Mvc\I18n\TranslatorFactory::class, |
|
40 | - 'FilterManager' => \Zend\Filter\FilterPluginManagerFactory::class, |
|
38 | + 'factories' => [ |
|
39 | + 'mvctranslator' => \Zend\Mvc\I18n\TranslatorFactory::class, |
|
40 | + 'FilterManager' => \Zend\Filter\FilterPluginManagerFactory::class, |
|
41 | 41 | 'Tracy' => [\Core\Service\Tracy::class,'factory'], |
42 | 42 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
43 | 43 | ], |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | ], |
64 | 64 | |
65 | 65 | 'controllers' => [ |
66 | - 'abstract_factories' => [ |
|
67 | - \Install\Factory\Controller\LazyControllerFactory::class |
|
68 | - ], |
|
66 | + 'abstract_factories' => [ |
|
67 | + \Install\Factory\Controller\LazyControllerFactory::class |
|
68 | + ], |
|
69 | 69 | ], |
70 | 70 | |
71 | 71 | 'controller_plugins' => [ |
@@ -69,7 +69,7 @@ |
||
69 | 69 | $attr = array(); |
70 | 70 | |
71 | 71 | foreach ($attributes as $name => $value) { |
72 | - $attr[] = $escape($name) . (strlen($value) ? ('="' . $escapeAttr($value) . '"') : ''); |
|
72 | + $attr[] = $escape($name).(strlen($value) ? ('="'.$escapeAttr($value).'"') : ''); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | return implode(' ', $attr); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * Switch to another user. |
121 | 121 | * |
122 | - * @param string|UserInterface $id user id of the user to switch to. |
|
122 | + * @param string $id user id of the user to switch to. |
|
123 | 123 | * @param array $params Additional parameters to store in the session container. |
124 | 124 | * |
125 | 125 | * @return bool |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | /** |
223 | 223 | * Gets the session container. |
224 | 224 | * |
225 | - * @return Container |
|
225 | + * @return string |
|
226 | 226 | */ |
227 | 227 | private function getSessionContainer() |
228 | 228 | { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * @param $user |
|
157 | + * @param \Auth\Entity\UserInterface $user |
|
158 | 158 | * @return $this |
159 | 159 | */ |
160 | 160 | protected function setUser($user) |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | /** |
248 | 248 | * Email-Address |
249 | 249 | * @param $email string |
250 | - * @return mixed |
|
250 | + * @return Register |
|
251 | 251 | */ |
252 | 252 | protected function setEmail($email) |
253 | 253 | { |
@@ -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 |
@@ -21,8 +21,8 @@ |
||
21 | 21 | protected $elementName; |
22 | 22 | |
23 | 23 | /** |
24 | - * @param $name |
|
25 | - * @param $strategy |
|
24 | + * @param string $name |
|
25 | + * @param Strategy\FileUploadStrategy $strategy |
|
26 | 26 | */ |
27 | 27 | public function __construct($name, $strategy) |
28 | 28 | { |
@@ -29,6 +29,9 @@ |
||
29 | 29 | { |
30 | 30 | } |
31 | 31 | |
32 | + /** |
|
33 | + * @param EntityHydrator $hydrator |
|
34 | + */ |
|
32 | 35 | public function injectHydrator($hydrator) |
33 | 36 | { |
34 | 37 | if (empty($hydrator) || !$hydrator instanceof AbstractHydrator) { |