@@ -24,7 +24,7 @@ |
||
24 | 24 | public function getHydrator() |
25 | 25 | { |
26 | 26 | if (!$this->hydrator) { |
27 | - $hydrator = new EntityHydrator(); |
|
27 | + $hydrator = new EntityHydrator(); |
|
28 | 28 | $this->setHydrator($hydrator); |
29 | 29 | } |
30 | 30 | return $this->hydrator; |
@@ -513,10 +513,10 @@ discard block |
||
513 | 513 | public function getLocation() |
514 | 514 | { |
515 | 515 | if (null === $this->location) { |
516 | - $array=[]; |
|
517 | - if(null != $this->locations){ |
|
516 | + $array = []; |
|
517 | + if (null != $this->locations) { |
|
518 | 518 | foreach ($this->locations as $location) { /* @var \Core\Entity\LocationInterface $location */ |
519 | - $array[]=$location->getCity(); |
|
519 | + $array[] = $location->getCity(); |
|
520 | 520 | } |
521 | 521 | return implode(', ', $array); |
522 | 522 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | if ($removePermissions) { |
572 | 572 | $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL); |
573 | 573 | } |
574 | - $this->user=null; |
|
574 | + $this->user = null; |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | return $this; |
@@ -579,8 +579,8 @@ discard block |
||
579 | 579 | |
580 | 580 | public function unsetOrganization($removePermissions = true) |
581 | 581 | { |
582 | - if($this->organization && $removePermissions){ |
|
583 | - $this->getPermissions()->revoke($this->organization,Permissions::PERMISSION_ALL); |
|
582 | + if ($this->organization && $removePermissions) { |
|
583 | + $this->getPermissions()->revoke($this->organization, Permissions::PERMISSION_ALL); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | $this->organization = null; |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $organization = $this->organization; |
833 | 833 | if (is_object($organization) && $organization->getImage()) { |
834 | 834 | $organizationImage = $organization->getImage(); |
835 | - return "/file/Organizations.OrganizationImage/" . $organizationImage->getId(); |
|
835 | + return "/file/Organizations.OrganizationImage/".$organizationImage->getId(); |
|
836 | 836 | } |
837 | 837 | return $this->logoRef; |
838 | 838 | } |
@@ -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,8 +75,8 @@ 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']:[]; |
|
79 | - $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig); |
|
78 | + $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : []; |
|
79 | + $this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'Auth\Entity\UserImage', |
99 | 99 | 'Organizations\Entity\OrganizationName', |
100 | 100 | ]; |
101 | - foreach($documents as $document){ |
|
101 | + foreach ($documents as $document) { |
|
102 | 102 | $dm->createQueryBuilder($document) |
103 | 103 | ->remove() |
104 | 104 | ->getQuery() |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | { |
127 | 127 | $provider = strtolower($provider); |
128 | 128 | $mink = $this->minkContext; |
129 | - foreach($this->socialLoginInfo[$provider] as $field=>$value){ |
|
130 | - $mink->fillField($field,$value); |
|
129 | + foreach ($this->socialLoginInfo[$provider] as $field=>$value) { |
|
130 | + $mink->fillField($field, $value); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | * @Given I am logged in as a recruiter |
136 | 136 | * @Given I am logged in as a recruiter with :organization as organization |
137 | 137 | */ |
138 | - public function iAmLoggedInAsARecruiter($organization=null) |
|
138 | + public function iAmLoggedInAsARecruiter($organization = null) |
|
139 | 139 | { |
140 | 140 | $user = $this->thereIsAUserIdentifiedBy( |
141 | 141 | '[email protected]', |
142 | - 'test',User::ROLE_RECRUITER, |
|
142 | + 'test', User::ROLE_RECRUITER, |
|
143 | 143 | 'Test Recruiter', |
144 | 144 | $organization |
145 | 145 | ); |
146 | - $this->startLogin($user,'test'); |
|
147 | - if(!is_null($organization)){ |
|
148 | - $this->iHaveMainOrganization($user,$organization); |
|
146 | + $this->startLogin($user, 'test'); |
|
147 | + if (!is_null($organization)) { |
|
148 | + $this->iHaveMainOrganization($user, $organization); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | public function iDonTHaveUser($login) |
157 | 157 | { |
158 | 158 | $repo = $this->getUserRepository(); |
159 | - $user=$repo->findByLogin($login); |
|
160 | - if($user instanceof UserInterface){ |
|
161 | - $repo->remove($user,true); |
|
159 | + $user = $repo->findByLogin($login); |
|
160 | + if ($user instanceof UserInterface) { |
|
161 | + $repo->remove($user, true); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @param $role |
168 | 168 | * @param TableNode $fields |
169 | 169 | */ |
170 | - public function iHaveUserWithTheFollowing($role,TableNode $fields) |
|
170 | + public function iHaveUserWithTheFollowing($role, TableNode $fields) |
|
171 | 171 | { |
172 | 172 | $normalizedFields = [ |
173 | 173 | 'login' => '[email protected]', |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | 'password' => 'test', |
177 | 177 | 'organization' => 'Cross Solution' |
178 | 178 | ]; |
179 | - foreach($fields->getRowsHash() as $field=>$value){ |
|
179 | + foreach ($fields->getRowsHash() as $field=>$value) { |
|
180 | 180 | $field = Inflector::camelize($field); |
181 | 181 | $normalizedFields[$field] = $value; |
182 | 182 | } |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function iAmLoggedInAsAnAdmin() |
198 | 198 | { |
199 | - $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN); |
|
200 | - $this->startLogin($user,'test'); |
|
199 | + $user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN); |
|
200 | + $this->startLogin($user, 'test'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | private function startLogin(UserInterface $user, $password) |
204 | 204 | { |
205 | 205 | $currentUser = $this->currentUser; |
206 | - if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){ |
|
206 | + if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) { |
|
207 | 207 | $this->iWantToLogIn(); |
208 | 208 | $this->iSpecifyTheUsernameAs($user->getLogin()); |
209 | 209 | $this->iSpecifyThePasswordAs($password); |
@@ -223,15 +223,15 @@ discard block |
||
223 | 223 | /** |
224 | 224 | * @Given there is a user :email identified by :password |
225 | 225 | */ |
226 | - public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null) |
|
226 | + public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null) |
|
227 | 227 | { |
228 | 228 | $repo = $this->getUserRepository(); |
229 | - if(!is_object($user=$repo->findByEmail($email))){ |
|
230 | - $user = $this->createUser($email,$password,$role,$fullname,$organization); |
|
229 | + if (!is_object($user = $repo->findByEmail($email))) { |
|
230 | + $user = $this->createUser($email, $password, $role, $fullname, $organization); |
|
231 | 231 | } |
232 | 232 | |
233 | - if(!is_null($organization)){ |
|
234 | - $this->iHaveMainOrganization($user,$organization); |
|
233 | + if (!is_null($organization)) { |
|
234 | + $this->iHaveMainOrganization($user, $organization); |
|
235 | 235 | } |
236 | 236 | $this->addCreatedUser($user); |
237 | 237 | $repo->getDocumentManager()->refresh($user); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * |
248 | 248 | * @return \Auth\Entity\UserInterface |
249 | 249 | */ |
250 | - public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
|
250 | + public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter") |
|
251 | 251 | { |
252 | 252 | /* @var Register $service */ |
253 | 253 | /* @var User $user */ |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | $user->setRole($role); |
259 | 259 | $settings = $user->getSettings('Applications'); |
260 | 260 | |
261 | - $expFullName = explode(' ',$fullname); |
|
261 | + $expFullName = explode(' ', $fullname); |
|
262 | 262 | $info = $user->getInfo(); |
263 | 263 | $info->setFirstName(array_shift($expFullName)); |
264 | - $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):''); |
|
264 | + $info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : ''); |
|
265 | 265 | $info->setEmail($email); |
266 | 266 | $info->setEmailVerified(true); |
267 | 267 | $repo->store($user); |
@@ -286,20 +286,20 @@ discard block |
||
286 | 286 | * @When I have :organization as my main organization |
287 | 287 | * @param $orgName |
288 | 288 | */ |
289 | - public function iHaveMainOrganization(UserInterface $user,$orgName) |
|
289 | + public function iHaveMainOrganization(UserInterface $user, $orgName) |
|
290 | 290 | { |
291 | 291 | /* @var $repoOrganization OrganizationRepository */ |
292 | 292 | $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
293 | 293 | $result = $repoOrganization->findByName($orgName); |
294 | - $organization = count($result) > 0 ? $result[0]:null; |
|
295 | - if(!$organization instanceof Organization){ |
|
294 | + $organization = count($result) > 0 ? $result[0] : null; |
|
295 | + if (!$organization instanceof Organization) { |
|
296 | 296 | $organization = new Organization(); |
297 | 297 | $organizationName = new OrganizationName($orgName); |
298 | 298 | $organization->setOrganizationName($organizationName); |
299 | 299 | } |
300 | 300 | $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE); |
301 | 301 | $permissions = $organization->getPermissions(); |
302 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
302 | + $permissions->grant($user, Permissions::PERMISSION_ALL); |
|
303 | 303 | |
304 | 304 | $organization->setUser($user); |
305 | 305 | $repoOrganization->store($organization); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | */ |
333 | 333 | public function iSpecifyTheUsernameAs($username) |
334 | 334 | { |
335 | - $this->minkContext->fillField('Login name',$username); |
|
335 | + $this->minkContext->fillField('Login name', $username); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function iSpecifyThePasswordAs($password) |
342 | 342 | { |
343 | - $this->minkContext->fillField('Password',$password); |
|
343 | + $this->minkContext->fillField('Password', $password); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | $repo = $this->getUserRepository(); |
352 | 352 | $user = $repo->findByLogin($username); |
353 | 353 | |
354 | - if(!$user instanceof User){ |
|
355 | - throw new \Exception(sprintf('There is no user with this login: "%s"',$username)); |
|
354 | + if (!$user instanceof User) { |
|
355 | + throw new \Exception(sprintf('There is no user with this login: "%s"', $username)); |
|
356 | 356 | } |
357 | 357 | $this->iWantToLogIn(); |
358 | 358 | $this->iSpecifyTheUsernameAs($username); |
@@ -408,13 +408,13 @@ discard block |
||
408 | 408 | { |
409 | 409 | $repo = $this->getUserRepository(); |
410 | 410 | $data = $table->getRowsHash(); |
411 | - $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
412 | - $password = isset($data['password']) ? $data['password']:'test'; |
|
413 | - $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
414 | - $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
411 | + $email = isset($data['email']) ? $data['email'] : '[email protected]'; |
|
412 | + $password = isset($data['password']) ? $data['password'] : 'test'; |
|
413 | + $fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User'; |
|
414 | + $role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER; |
|
415 | 415 | |
416 | - if(!is_object($user=$repo->findByLogin($email))){ |
|
417 | - $user = $this->createUser($email,$password,$role,$fullname); |
|
416 | + if (!is_object($user = $repo->findByLogin($email))) { |
|
417 | + $user = $this->createUser($email, $password, $role, $fullname); |
|
418 | 418 | } |
419 | 419 | $this->currentUser = $user; |
420 | 420 | $this->addCreatedUser($user); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | |
423 | 423 | private function addCreatedUser(UserInterface $user) |
424 | 424 | { |
425 | - if(!in_array($user,static::$users)){ |
|
425 | + if (!in_array($user, static::$users)) { |
|
426 | 426 | static::$users[] = $user; |
427 | 427 | } |
428 | 428 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function getCurrentUser() |
444 | 444 | { |
445 | - if(!$this->currentUser instanceof User){ |
|
445 | + if (!$this->currentUser instanceof User) { |
|
446 | 446 | throw new FailedExpectationException('Need to login first before use this step'); |
447 | 447 | } |
448 | 448 | return $this->currentUser; |
@@ -51,16 +51,16 @@ |
||
51 | 51 | $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
52 | 52 | } |
53 | 53 | |
54 | - public function buildUrl($name, array $params=array(), array $options=array()) |
|
54 | + public function buildUrl($name, array $params = array(), array $options = array()) |
|
55 | 55 | { |
56 | 56 | $defaults = ['lang'=>'en']; |
57 | - $params = array_merge($defaults,$params); |
|
57 | + $params = array_merge($defaults, $params); |
|
58 | 58 | /* @var Url $urlHelper */ |
59 | 59 | $urlHelper = $this |
60 | 60 | ->getService('ViewHelperManager') |
61 | 61 | ->get('url') |
62 | 62 | ; |
63 | - $url = $urlHelper($name,$params,$options); |
|
63 | + $url = $urlHelper($name, $params, $options); |
|
64 | 64 | |
65 | 65 | return $this->coreContext->generateUrl($url); |
66 | 66 | } |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function setupContexts(BeforeScenarioScope $scope) |
37 | 37 | { |
38 | - if(false === static::$jobCategoryChecked){ |
|
38 | + if (false === static::$jobCategoryChecked) { |
|
39 | 39 | /* @var Categories $catRepo */ |
40 | 40 | $catRepo = $this->getRepositories()->get('Jobs/Category'); |
41 | 41 | $all = $catRepo->findAll(); |
42 | - if(count($all) <= 1){ |
|
42 | + if (count($all) <= 1) { |
|
43 | 43 | $catRepo->createDefaultCategory('professions'); |
44 | 44 | $catRepo->createDefaultCategory('industries'); |
45 | 45 | $catRepo->createDefaultCategory('employmentTypes'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getApplication() |
55 | 55 | { |
56 | - if(!is_object(static::$application)){ |
|
56 | + if (!is_object(static::$application)) { |
|
57 | 57 | $configFile = realpath(__DIR__.'/../../../config/config.php'); |
58 | 58 | $config = include($configFile); |
59 | 59 | static::$application = Application::init($config); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function iSubmitTheFormWithId($arg) |
138 | 138 | { |
139 | 139 | $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
140 | - if($node) { |
|
140 | + if ($node) { |
|
141 | 141 | $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
142 | 142 | } else { |
143 | 143 | throw new \Exception('Element not found'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | public function iSetMainWindowName() |
162 | 162 | { |
163 | 163 | $window_name = 'main_window'; |
164 | - $script = 'window.name = "' . $window_name . '"'; |
|
164 | + $script = 'window.name = "'.$window_name.'"'; |
|
165 | 165 | $this->getSession()->executeScript($script); |
166 | 166 | } |
167 | 167 | |
@@ -220,14 +220,14 @@ discard block |
||
220 | 220 | break; |
221 | 221 | |
222 | 222 | default: |
223 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
223 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
224 | 224 | break; |
225 | 225 | } |
226 | 226 | |
227 | 227 | try { |
228 | 228 | $this->getSession()->executeScript($function); |
229 | 229 | } catch (\Exception $e) { |
230 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
230 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | * |
248 | 248 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
249 | 249 | */ |
250 | - public function getElement($locator,$selector='css') |
|
250 | + public function getElement($locator, $selector = 'css') |
|
251 | 251 | { |
252 | 252 | $page = $this->minkContext->getSession()->getPage(); |
253 | - $element = $page->find('css',$locator); |
|
253 | + $element = $page->find('css', $locator); |
|
254 | 254 | return $element; |
255 | 255 | } |
256 | 256 | |
@@ -282,12 +282,12 @@ discard block |
||
282 | 282 | $session = $this->getSession(); |
283 | 283 | $element = $session->getPage()->find( |
284 | 284 | 'xpath', |
285 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
285 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]') |
|
286 | 286 | ); |
287 | - if(null === $element){ |
|
287 | + if (null === $element) { |
|
288 | 288 | $element = $session->getPage()->find( |
289 | 289 | 'named', |
290 | - array('id',$text) |
|
290 | + array('id', $text) |
|
291 | 291 | ); |
292 | 292 | } |
293 | 293 | if (null === $element) { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function iGoToEmailTemplatePage() |
33 | 33 | { |
34 | - $url = $this->buildUrl('lang/settings',[ |
|
34 | + $url = $this->buildUrl('lang/settings', [ |
|
35 | 35 | 'module' => 'Applications' |
36 | 36 | ]); |
37 | 37 | $this->visit($url); |
@@ -35,13 +35,13 @@ |
||
35 | 35 | /* @var $repo JobRepository */ |
36 | 36 | $repo = $this->getRepository('Jobs/Job'); |
37 | 37 | $job = $repo->findOneBy(['title' => $title]); |
38 | - if(!$job instanceof Job){ |
|
38 | + if (!$job instanceof Job) { |
|
39 | 39 | throw new \Exception('There is no job titled: "'.$title.'"'); |
40 | 40 | } |
41 | 41 | $job->setApplyId($job->getId()); |
42 | 42 | $repo->store($job); |
43 | 43 | |
44 | - $url = $this->buildUrl('lang/apply',[ |
|
44 | + $url = $this->buildUrl('lang/apply', [ |
|
45 | 45 | 'applyId' => $job->getApplyId() |
46 | 46 | ]); |
47 | 47 | $this->visit($url); |
@@ -36,47 +36,47 @@ discard block |
||
36 | 36 | RepositoryService::class => 'repositories', |
37 | 37 | ]; |
38 | 38 | |
39 | - public function canCreate( ContainerInterface $container, $requestedName ) |
|
39 | + public function canCreate(ContainerInterface $container, $requestedName) |
|
40 | 40 | { |
41 | - return strstr( $requestedName,'\Controller') !== false; |
|
41 | + return strstr($requestedName, '\Controller') !== false; |
|
42 | 42 | } |
43 | 43 | |
44 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
44 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
45 | 45 | { |
46 | 46 | $className = $this->getClassName($requestedName); |
47 | 47 | $class = new \ReflectionClass($className); |
48 | 48 | |
49 | - if( $constructor = $class->getConstructor() ) |
|
49 | + if ($constructor = $class->getConstructor()) |
|
50 | 50 | { |
51 | - if( $params = $constructor->getParameters() ) |
|
51 | + if ($params = $constructor->getParameters()) |
|
52 | 52 | { |
53 | 53 | $constructorArgs = []; |
54 | - foreach( $params as $p ) |
|
54 | + foreach ($params as $p) |
|
55 | 55 | { |
56 | 56 | $serviceName = ''; |
57 | - if( $p->getClass() ) { |
|
57 | + if ($p->getClass()) { |
|
58 | 58 | $serviceName = $p->getClass()->getName(); |
59 | 59 | if (array_key_exists($serviceName, $this->aliases)) { |
60 | 60 | $serviceName = $this->aliases[$serviceName]; |
61 | 61 | } |
62 | 62 | } |
63 | - else{ |
|
64 | - if( $p->getName() == 'config' ){ |
|
63 | + else { |
|
64 | + if ($p->getName() == 'config') { |
|
65 | 65 | $serviceName = 'config'; |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - if(!$container->has($serviceName)){ |
|
69 | + if (!$container->has($serviceName)) { |
|
70 | 70 | throw new ServiceNotCreatedException(sprintf( |
71 | 71 | 'Can\'t create constructor argument "%s" for service "%s"', |
72 | - $p->getName(),$requestedName |
|
72 | + $p->getName(), $requestedName |
|
73 | 73 | )); |
74 | 74 | } |
75 | 75 | try { |
76 | 76 | $constructorArgs[] = $container->get($serviceName); |
77 | 77 | } |
78 | 78 | catch (\Exception $x) { |
79 | - echo __CLASS__ . " couldn't create an instance of {$p->getName()} to satisfy the constructor for $requestedName."; |
|
79 | + echo __CLASS__." couldn't create an instance of {$p->getName()} to satisfy the constructor for $requestedName."; |
|
80 | 80 | exit; |
81 | 81 | } |
82 | 82 | } |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function getClassName($requestedName) |
97 | 97 | { |
98 | - $exp = explode('/',$requestedName); |
|
98 | + $exp = explode('/', $requestedName); |
|
99 | 99 | |
100 | - $className = array_shift($exp).'\\Controller\\'.implode('\\',$exp).'Controller'; |
|
101 | - if(!class_exists($className)){ |
|
100 | + $className = array_shift($exp).'\\Controller\\'.implode('\\', $exp).'Controller'; |
|
101 | + if (!class_exists($className)) { |
|
102 | 102 | throw new ServiceNotCreatedException( |
103 | 103 | sprintf( |
104 | 104 | 'Can\'t find correct controller class for "%s"', |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | use Core\Factory\Controller\LazyControllerFactory; |
18 | 18 | use Zend\I18n\Translator\Resources; |
19 | 19 | |
20 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
20 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
21 | 21 | |
22 | 22 | |
23 | 23 | return array( |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'doctrine' => $doctrineConfig, |
26 | 26 | |
27 | 27 | 'options' => [ |
28 | - 'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ], |
|
28 | + 'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'], |
|
29 | 29 | ], |
30 | 30 | |
31 | 31 | 'Core' => array( |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'name' => 'stream', |
46 | 46 | 'priority' => 1000, |
47 | 47 | 'options' => array( |
48 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
48 | + 'stream' => __DIR__.'/../../../log/yawik.log', |
|
49 | 49 | ), |
50 | 50 | ), |
51 | 51 | ), |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'name' => 'stream', |
57 | 57 | 'priority' => 1000, |
58 | 58 | 'options' => array( |
59 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
59 | + 'stream' => __DIR__.'/../../../log/mails.log', |
|
60 | 60 | ), |
61 | 61 | ), |
62 | 62 | ), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
74 | 74 | 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
75 | 75 | 'strict' => true, // bool = cause immediate death|int = matched against error severity |
76 | - 'log' => __DIR__ . '/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
76 | + 'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
77 | 77 | 'email' => null, // in production mode notifies the recipient |
78 | 78 | 'email_snooze' => 900 // interval for sending email in seconds |
79 | 79 | ], |
@@ -218,16 +218,16 @@ discard block |
||
218 | 218 | 'Core/JsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory', |
219 | 219 | 'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory', |
220 | 220 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
221 | - 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'], |
|
222 | - 'DefaultListeners' => ['Core\Listener\DefaultListener','factory'], |
|
223 | - 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'], |
|
224 | - 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'], |
|
221 | + 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'], |
|
222 | + 'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'], |
|
223 | + 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'], |
|
224 | + 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'], |
|
225 | 225 | 'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory', |
226 | 226 | 'Core/Locale' => 'Core\I18n\LocaleFactory', |
227 | 227 | \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class, |
228 | 228 | \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class, |
229 | 229 | 'Imagine' => \Core\Factory\Service\ImagineFactory::class, |
230 | - 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'], |
|
230 | + 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'], |
|
231 | 231 | ), |
232 | 232 | 'abstract_factories' => array( |
233 | 233 | 'Core\Factory\OptionsAbstractFactory', |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'translation_file_patterns' => array( |
251 | 251 | [ |
252 | 252 | 'type' => 'gettext', |
253 | - 'base_dir' => __DIR__ . '/../language', |
|
253 | + 'base_dir' => __DIR__.'/../language', |
|
254 | 254 | 'pattern' => '%s.mo', |
255 | 255 | ], |
256 | 256 | [ |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | 'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory', |
306 | 306 | 'listquery' => 'Core\Controller\Plugin\ListQuery::factory', |
307 | 307 | 'mail' => 'Core\Controller\Plugin\Mail::factory', |
308 | - 'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'], |
|
309 | - 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'], |
|
310 | - 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'], |
|
308 | + 'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'], |
|
309 | + 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'], |
|
310 | + 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'], |
|
311 | 311 | ), |
312 | 312 | 'invokables' => array( |
313 | 313 | 'Core/FileSender' => 'Core\Controller\Plugin\FileSender', |
@@ -337,32 +337,32 @@ discard block |
||
337 | 337 | 'exception_template' => 'error/index', |
338 | 338 | // Map template to files. Speeds up the lookup through the template stack. |
339 | 339 | 'template_map' => array( |
340 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
341 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
342 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
343 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
344 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
345 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
346 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
347 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
348 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
349 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
350 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
351 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
352 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
353 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
354 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
355 | - 'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml', |
|
356 | - 'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml', |
|
357 | - 'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml', |
|
358 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
359 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
360 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
340 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
341 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
342 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
343 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
344 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
345 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
346 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
347 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
348 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
349 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
350 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
351 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
352 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
353 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
354 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
355 | + 'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml', |
|
356 | + 'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml', |
|
357 | + 'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml', |
|
358 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
359 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
360 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
361 | 361 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
362 | 362 | ), |
363 | 363 | // Where to look for view templates not mapped above |
364 | 364 | 'template_path_stack' => array( |
365 | - __DIR__ . '/../view', |
|
365 | + __DIR__.'/../view', |
|
366 | 366 | ), |
367 | 367 | ), |
368 | 368 | 'view_helpers' => array( |