@@ -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) { |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $repo = static::$jobRepo; |
| 59 | 59 | $results = $repo->findBy(['user' => $user]); |
| 60 | - foreach($results as $result){ |
|
| 61 | - $repo->remove($result,true); |
|
| 60 | + foreach ($results as $result) { |
|
| 61 | + $repo->remove($result, true); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function beforeScenario(BeforeScenarioScope $scope) |
| 71 | 71 | { |
| 72 | 72 | $this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class); |
| 73 | - if(is_null(static::$jobRepo)){ |
|
| 73 | + if (is_null(static::$jobRepo)) { |
|
| 74 | 74 | $this->gatherContexts($scope); |
| 75 | 75 | static::$jobRepo = $this->getJobRepository(); |
| 76 | 76 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function iGoToCreateJob() |
| 91 | 91 | { |
| 92 | - $url = $this->buildUrl('lang/jobs/manage',['action' => 'edit']); |
|
| 92 | + $url = $this->buildUrl('lang/jobs/manage', ['action' => 'edit']); |
|
| 93 | 93 | $this->visit($url); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | public function iGoToEditJobWithTitle($jobTitle) |
| 110 | 110 | { |
| 111 | 111 | $job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]); |
| 112 | - if(!$job instanceof Job){ |
|
| 113 | - throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle)); |
|
| 112 | + if (!$job instanceof Job) { |
|
| 113 | + throw new \Exception(sprintf('Job with title "%s" is not found', $jobTitle)); |
|
| 114 | 114 | } |
| 115 | 115 | $this->currentJob = $job; |
| 116 | - $url = $this->buildUrl('lang/jobs/manage',[ |
|
| 116 | + $url = $this->buildUrl('lang/jobs/manage', [ |
|
| 117 | 117 | 'id' => $job->getId() |
| 118 | 118 | ]); |
| 119 | 119 | $this->visit($url); |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $jobRepository = $this->getJobRepository(); |
| 141 | 141 | $results = $jobRepository->getUserJobs($user->getId()); |
| 142 | - foreach($results as $job){ |
|
| 143 | - $jobRepository->remove($job,true); |
|
| 142 | + foreach ($results as $job) { |
|
| 143 | + $jobRepository->remove($job, true); |
|
| 144 | 144 | } |
| 145 | 145 | $this->currentJob = null; |
| 146 | 146 | } |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | * @When I fill job location search with :search and choose :choice |
| 150 | 150 | * |
| 151 | 151 | */ |
| 152 | - public function iFillJobLocationAndChoose($search,$choice) |
|
| 152 | + public function iFillJobLocationAndChoose($search, $choice) |
|
| 153 | 153 | { |
| 154 | 154 | $select2 = $this->select2Context; |
| 155 | - $select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice); |
|
| 155 | + $select2->iFillInSelect2FieldWith('jobBase[geoLocation]', $search, $choice); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * @When I choose :value from :field |
| 160 | 160 | */ |
| 161 | - public function iJobClassificationSelect($value,$field) |
|
| 161 | + public function iJobClassificationSelect($value, $field) |
|
| 162 | 162 | { |
| 163 | 163 | $field = Inflector::camelize($field); |
| 164 | 164 | |
@@ -174,18 +174,18 @@ discard block |
||
| 174 | 174 | 'employmentTypes' => "select#classifications-employmentTypes", |
| 175 | 175 | ]; |
| 176 | 176 | |
| 177 | - if(!isset($mapSelect2[$field])){ |
|
| 177 | + if (!isset($mapSelect2[$field])) { |
|
| 178 | 178 | throw new \Exception('Undefined field selection value "'.$field.'"'); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $multipleField = $mapMultiple[$field]; |
| 182 | 182 | $page = $this->minkContext->getSession()->getPage(); |
| 183 | - $element = $page->find('css',$mapMultiple[$field]); |
|
| 184 | - if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){ |
|
| 185 | - $this->minkContext->selectOption($value,$multipleField); |
|
| 186 | - }else{ |
|
| 183 | + $element = $page->find('css', $mapMultiple[$field]); |
|
| 184 | + if (!is_null($element) && $element->getAttribute('multiple') == 'multiple') { |
|
| 185 | + $this->minkContext->selectOption($value, $multipleField); |
|
| 186 | + } else { |
|
| 187 | 187 | $locator = $mapSelect2[$field]; |
| 188 | - $this->select2Context->iFillInSelect2Field($locator,$value); |
|
| 188 | + $this->select2Context->iFillInSelect2Field($locator, $value); |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
@@ -209,62 +209,62 @@ discard block |
||
| 209 | 209 | * @When I have a :status job with the following: |
| 210 | 210 | * @param TableNode $fields |
| 211 | 211 | */ |
| 212 | - public function iHaveAJobWithTheFollowing($status,TableNode $fields) |
|
| 212 | + public function iHaveAJobWithTheFollowing($status, TableNode $fields) |
|
| 213 | 213 | { |
| 214 | 214 | $normalizedField = [ |
| 215 | 215 | 'template' => 'modern', |
| 216 | 216 | ]; |
| 217 | - foreach($fields->getRowsHash() as $field => $value){ |
|
| 217 | + foreach ($fields->getRowsHash() as $field => $value) { |
|
| 218 | 218 | $field = Inflector::camelize($field); |
| 219 | - if($field == 'professions' || $field == 'industries'){ |
|
| 220 | - $value = explode(',',$value); |
|
| 219 | + if ($field == 'professions' || $field == 'industries') { |
|
| 220 | + $value = explode(',', $value); |
|
| 221 | 221 | } |
| 222 | 222 | $normalizedField[$field] = $value; |
| 223 | 223 | } |
| 224 | 224 | $jobRepo = $this->getJobRepository(); |
| 225 | 225 | $job = $jobRepo->findOneBy(['title' => $normalizedField['title']]); |
| 226 | - if(!$job instanceof Job){ |
|
| 226 | + if (!$job instanceof Job) { |
|
| 227 | 227 | $job = new Job(); |
| 228 | 228 | $job->setTitle($normalizedField['title']); |
| 229 | 229 | } |
| 230 | - if(isset($normalizedField['user'])){ |
|
| 230 | + if (isset($normalizedField['user'])) { |
|
| 231 | 231 | /* @var $userRepo UserRepository */ |
| 232 | 232 | $user = $this->getUserContext()->getCurrentUser(); |
| 233 | 233 | $jobRepo->getDocumentManager()->refresh($user); |
| 234 | - if($user instanceof User){ |
|
| 234 | + if ($user instanceof User) { |
|
| 235 | 235 | $job->setUser($user); |
| 236 | 236 | $job->setOrganization($user->getOrganization()->getOrganization()); |
| 237 | - }else{ |
|
| 237 | + } else { |
|
| 238 | 238 | throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']); |
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if($status == 'draft'){ |
|
| 242 | + if ($status == 'draft') { |
|
| 243 | 243 | $job->setIsDraft(true); |
| 244 | - }elseif($status == 'published'){ |
|
| 244 | + }elseif ($status == 'published') { |
|
| 245 | 245 | $job->setIsDraft(false); |
| 246 | 246 | $job->setDatePublishStart(new \DateTime()); |
| 247 | 247 | } |
| 248 | 248 | $job->setStatus(Status::ACTIVE); |
| 249 | 249 | |
| 250 | - if(isset($normalizedField['location'])){ |
|
| 251 | - $this->setLocation($job,$normalizedField['location']); |
|
| 250 | + if (isset($normalizedField['location'])) { |
|
| 251 | + $this->setLocation($job, $normalizedField['location']); |
|
| 252 | 252 | } |
| 253 | - if(isset($normalizedField['companyName'])){ |
|
| 253 | + if (isset($normalizedField['companyName'])) { |
|
| 254 | 254 | //$job->setCompany($normalizedField['companyName']); |
| 255 | 255 | } |
| 256 | - if(isset($normalizedField['professions'])){ |
|
| 257 | - $this->addProfessions($job,$normalizedField['professions']); |
|
| 256 | + if (isset($normalizedField['professions'])) { |
|
| 257 | + $this->addProfessions($job, $normalizedField['professions']); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - if(isset($normalizedField['industries'])){ |
|
| 261 | - $this->addIndustries($job,$normalizedField['industries']); |
|
| 260 | + if (isset($normalizedField['industries'])) { |
|
| 261 | + $this->addIndustries($job, $normalizedField['industries']); |
|
| 262 | 262 | } |
| 263 | - if(isset($normalizedField['employmentTypes'])){ |
|
| 263 | + if (isset($normalizedField['employmentTypes'])) { |
|
| 264 | 264 | $types = $this->getCategories([$normalizedField['employmentTypes']]); |
| 265 | 265 | $type = array_shift($types); |
| 266 | 266 | $values = $job->getClassifications()->getEmploymentTypes()->getValues(); |
| 267 | - if(!is_array($values) || !in_array($type,$values)){ |
|
| 267 | + if (!is_array($values) || !in_array($type, $values)) { |
|
| 268 | 268 | $job->getClassifications()->getEmploymentTypes()->getItems()->add($type); |
| 269 | 269 | } |
| 270 | 270 | } |
@@ -283,18 +283,18 @@ discard block |
||
| 283 | 283 | $location->fromString($serialized); |
| 284 | 284 | |
| 285 | 285 | $locations = $job->getLocations(); |
| 286 | - if(count($locations)){ |
|
| 286 | + if (count($locations)) { |
|
| 287 | 287 | $locations->clear(); |
| 288 | 288 | } |
| 289 | 289 | $job->getLocations()->add($location); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - private function addProfessions(Job &$job,$terms) |
|
| 292 | + private function addProfessions(Job &$job, $terms) |
|
| 293 | 293 | { |
| 294 | 294 | $professions = $this->getCategories($terms); |
| 295 | - foreach($professions as $profession){ |
|
| 295 | + foreach ($professions as $profession) { |
|
| 296 | 296 | $values = $job->getClassifications()->getProfessions()->getValues(); |
| 297 | - if(!is_array($values) || !in_array($profession,$values)){ |
|
| 297 | + if (!is_array($values) || !in_array($profession, $values)) { |
|
| 298 | 298 | $job->getClassifications()->getProfessions()->getItems()->add($profession); |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | private function addIndustries(Job &$job, $terms) |
| 304 | 304 | { |
| 305 | 305 | $industries = $this->getCategories($terms); |
| 306 | - foreach($industries as $industry){ |
|
| 306 | + foreach ($industries as $industry) { |
|
| 307 | 307 | $values = $job->getClassifications()->getIndustries()->getValues(); |
| 308 | - if(!is_array($values) || !in_array($industry,$values)){ |
|
| 308 | + if (!is_array($values) || !in_array($industry, $values)) { |
|
| 309 | 309 | $job->getClassifications()->getIndustries()->getItems()->add($industry); |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | $job = $repo->findDraft($user); |
| 342 | 342 | |
| 343 | - if(is_null($job)){ |
|
| 343 | + if (is_null($job)) { |
|
| 344 | 344 | $job = new Job(); |
| 345 | 345 | $job |
| 346 | 346 | ->setUser($user) |
@@ -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"', |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | if (array_key_exists($serviceName, $this->aliases)) { |
| 60 | 60 | $serviceName = $this->aliases[$serviceName]; |
| 61 | 61 | } |
| 62 | - } |
|
| 63 | - else{ |
|
| 62 | + } else{ |
|
| 64 | 63 | if( $p->getName() == 'config' ){ |
| 65 | 64 | $serviceName = 'config'; |
| 66 | 65 | } |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | } |
| 75 | 74 | try { |
| 76 | 75 | $constructorArgs[] = $container->get($serviceName); |
| 77 | - } |
|
| 78 | - catch (\Exception $x) { |
|
| 76 | + } catch (\Exception $x) { |
|
| 79 | 77 | echo __CLASS__ . " couldn't create an instance of {$p->getName()} to satisfy the constructor for $requestedName."; |
| 80 | 78 | exit; |
| 81 | 79 | } |
@@ -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( |