Completed
Pull Request — develop (#434)
by Carsten
06:27
created
module/Behat/src/OrganizationContext.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -23,39 +23,39 @@
 block discarded – undo
23 23
  */
24 24
 class OrganizationContext implements Context
25 25
 {
26
-	use CommonContextTrait;
26
+    use CommonContextTrait;
27 27
 	
28
-	/**
29
-	 * @Given I go to my organization page
30
-	 */
31
-	public function iGoToMyOrganizationPage()
32
-	{
33
-		$url = $this->coreContext->generateUrl('/en/my/organization');
34
-		$this->coreContext->iVisit($url);
35
-	}
28
+    /**
29
+     * @Given I go to my organization page
30
+     */
31
+    public function iGoToMyOrganizationPage()
32
+    {
33
+        $url = $this->coreContext->generateUrl('/en/my/organization');
34
+        $this->coreContext->iVisit($url);
35
+    }
36 36
 	
37
-	/**
38
-	 * @When I hover over name form
39
-	 */
40
-	public function iMouseOverOrganizationNameForm()
41
-	{
42
-		$locator = '#sf-nameForm .sf-summary';
43
-		$this->coreContext->iHoverOverTheElement($locator);
44
-	}
37
+    /**
38
+     * @When I hover over name form
39
+     */
40
+    public function iMouseOverOrganizationNameForm()
41
+    {
42
+        $locator = '#sf-nameForm .sf-summary';
43
+        $this->coreContext->iHoverOverTheElement($locator);
44
+    }
45 45
 	
46
-	/**
47
-	 * @Given I go to create new organization page
48
-	 */
49
-	public function iGoToCreateNewOrganizationPage()
50
-	{
51
-		$this->visit('/en/organizations/edit');
52
-	}
46
+    /**
47
+     * @Given I go to create new organization page
48
+     */
49
+    public function iGoToCreateNewOrganizationPage()
50
+    {
51
+        $this->visit('/en/organizations/edit');
52
+    }
53 53
 	
54
-	/**
55
-	 * @Given I go to organization overview page
56
-	 */
57
-	public function iGoToOrganizationOverviewPage()
58
-	{
59
-		$this->visit('/en/organizations');
60
-	}
54
+    /**
55
+     * @Given I go to organization overview page
56
+     */
57
+    public function iGoToOrganizationOverviewPage()
58
+    {
59
+        $this->visit('/en/organizations');
60
+    }
61 61
 }
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
module/Behat/src/SettingsContext.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 block discarded – undo
14 14
 
15 15
 class SettingsContext implements Context
16 16
 {
17
-	use CommonContextTrait;
17
+    use CommonContextTrait;
18 18
 	
19
-	/**
20
-	 * @Given I go to settings page
21
-	 */
22
-	public function iGoToSettingsPage()
23
-	{
24
-		$this->visit('/en/settings');
25
-	}
19
+    /**
20
+     * @Given I go to settings page
21
+     */
22
+    public function iGoToSettingsPage()
23
+    {
24
+        $this->visit('/en/settings');
25
+    }
26 26
 	
27
-	/**
28
-	 * @Given I go to email template settings page
29
-	 */
30
-	public function iGoToEmailTemplatePage()
31
-	{
32
-		$this->visit('/en/settings/Applications');
33
-	}
27
+    /**
28
+     * @Given I go to email template settings page
29
+     */
30
+    public function iGoToEmailTemplatePage()
31
+    {
32
+        $this->visit('/en/settings/Applications');
33
+    }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
module/Behat/src/JobContext.php 3 patches
Indentation   +273 added lines, -273 removed lines patch added patch discarded remove patch
@@ -33,312 +33,312 @@
 block discarded – undo
33 33
  */
34 34
 class JobContext implements Context
35 35
 {
36
-	use CommonContextTrait;
36
+    use CommonContextTrait;
37 37
 	
38
-	/**
39
-	 * @var Select2Context
40
-	 */
41
-	private $select2Context;
38
+    /**
39
+     * @var Select2Context
40
+     */
41
+    private $select2Context;
42 42
 	
43
-	/**
44
-	 * @var Job
45
-	 */
46
-	private $currentJob;
43
+    /**
44
+     * @var Job
45
+     */
46
+    private $currentJob;
47 47
 	
48
-	/**
49
-	 * @var JobRepository
50
-	 */
51
-	static private $jobRepo;
48
+    /**
49
+     * @var JobRepository
50
+     */
51
+    static private $jobRepo;
52 52
 	
53
-	/**
54
-	 * @param User $user
55
-	 */
56
-	static public function removeJobByUser(User $user)
57
-	{
58
-		$repo = static::$jobRepo;
59
-		$results = $repo->findBy(['user' => $user]);
60
-		foreach($results as $result){
61
-			$repo->remove($result,true);
62
-		}
63
-	}
53
+    /**
54
+     * @param User $user
55
+     */
56
+    static public function removeJobByUser(User $user)
57
+    {
58
+        $repo = static::$jobRepo;
59
+        $results = $repo->findBy(['user' => $user]);
60
+        foreach($results as $result){
61
+            $repo->remove($result,true);
62
+        }
63
+    }
64 64
 	
65
-	/**
66
-	 * @BeforeScenario
67
-	 *
68
-	 * @param BeforeScenarioScope $scope
69
-	 */
70
-	public function beforeScenario(BeforeScenarioScope $scope)
71
-	{
72
-		$this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class);
73
-		if(is_null(static::$jobRepo)){
74
-			$this->gatherContexts($scope);
75
-			static::$jobRepo = $this->getJobRepository();
76
-		}
77
-	}
65
+    /**
66
+     * @BeforeScenario
67
+     *
68
+     * @param BeforeScenarioScope $scope
69
+     */
70
+    public function beforeScenario(BeforeScenarioScope $scope)
71
+    {
72
+        $this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class);
73
+        if(is_null(static::$jobRepo)){
74
+            $this->gatherContexts($scope);
75
+            static::$jobRepo = $this->getJobRepository();
76
+        }
77
+    }
78 78
 	
79
-	/**
80
-	 * @Given I go to job board page
81
-	 */
82
-	public function iGoToJobBoardPage()
83
-	{
84
-		$this->visit('/en/jobboard');
85
-	}
79
+    /**
80
+     * @Given I go to job board page
81
+     */
82
+    public function iGoToJobBoardPage()
83
+    {
84
+        $this->visit('/en/jobboard');
85
+    }
86 86
 	
87
-	/**
88
-	 * @Given I go to create job page
89
-	 */
90
-	public function iGoToMyOrganizationPage()
91
-	{
92
-		$this->visit('/en/jobs/edit');
93
-	}
87
+    /**
88
+     * @Given I go to create job page
89
+     */
90
+    public function iGoToMyOrganizationPage()
91
+    {
92
+        $this->visit('/en/jobs/edit');
93
+    }
94 94
 	
95
-	/**
96
-	 * @Given I go to job overview page
97
-	 */
98
-	public function iGoToJobOverviewPage()
99
-	{
100
-		$this->visit('/en/jobs');
101
-	}
95
+    /**
96
+     * @Given I go to job overview page
97
+     */
98
+    public function iGoToJobOverviewPage()
99
+    {
100
+        $this->visit('/en/jobs');
101
+    }
102 102
 	
103
-	/**
104
-	 * @Given I go to edit job draft with title :jobTitle
105
-	 * @param $jobTitle
106
-	 * @throws \Exception when job is not found
107
-	 */
108
-	public function iGoToEditJobWithTitle($jobTitle)
109
-	{
110
-		$job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
111
-		if(!$job instanceof Job){
112
-			throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
113
-		}
114
-		$this->currentJob = $job;
115
-		$url = '/en/jobs/edit?id='.$job->getId();
116
-		$this->visit($url);
117
-	}
103
+    /**
104
+     * @Given I go to edit job draft with title :jobTitle
105
+     * @param $jobTitle
106
+     * @throws \Exception when job is not found
107
+     */
108
+    public function iGoToEditJobWithTitle($jobTitle)
109
+    {
110
+        $job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
111
+        if(!$job instanceof Job){
112
+            throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
113
+        }
114
+        $this->currentJob = $job;
115
+        $url = '/en/jobs/edit?id='.$job->getId();
116
+        $this->visit($url);
117
+    }
118 118
 	
119
-	/**
120
-	 * @Given I don't have any classification data
121
-	 */
122
-	public function iDonTHaveAnyClassificationData()
123
-	{
124
-		$this->currentJob->setClassifications(new Classifications());
125
-		$this->getJobRepository()->store($this->currentJob);
126
-	}
119
+    /**
120
+     * @Given I don't have any classification data
121
+     */
122
+    public function iDonTHaveAnyClassificationData()
123
+    {
124
+        $this->currentJob->setClassifications(new Classifications());
125
+        $this->getJobRepository()->store($this->currentJob);
126
+    }
127 127
 	
128
-	/**
129
-	 * @When I don't have any posted job
130
-	 */
131
-	public function iDonTHaveAnyPostedJob()
132
-	{
133
-		/* @var $jobRepository JobRepository */
134
-		/* @var $job Job */
135
-		$user = $this->getCurrentUser();
136
-		$jobRepository = $this->getJobRepository();
137
-		$results = $jobRepository->getUserJobs($user->getId());
138
-		foreach($results as $job){
139
-			$jobRepository->remove($job,true);
140
-		}
141
-		$this->currentJob = null;
142
-	}
128
+    /**
129
+     * @When I don't have any posted job
130
+     */
131
+    public function iDonTHaveAnyPostedJob()
132
+    {
133
+        /* @var $jobRepository JobRepository */
134
+        /* @var $job Job */
135
+        $user = $this->getCurrentUser();
136
+        $jobRepository = $this->getJobRepository();
137
+        $results = $jobRepository->getUserJobs($user->getId());
138
+        foreach($results as $job){
139
+            $jobRepository->remove($job,true);
140
+        }
141
+        $this->currentJob = null;
142
+    }
143 143
 	
144
-	/**
145
-	 * @When I fill job location search with :search and choose :choice
146
-	 *
147
-	 */
148
-	public function iFillJobLocationAndChoose($search,$choice)
149
-	{
150
-		$select2 = $this->select2Context;
151
-		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
152
-	}
144
+    /**
145
+     * @When I fill job location search with :search and choose :choice
146
+     *
147
+     */
148
+    public function iFillJobLocationAndChoose($search,$choice)
149
+    {
150
+        $select2 = $this->select2Context;
151
+        $select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
152
+    }
153 153
 	
154
-	/**
155
-	 * @When I choose :value from :field
156
-	 */
157
-	public function iJobClassificationSelect($value,$field)
158
-	{
159
-		$field = Inflector::camelize($field);
154
+    /**
155
+     * @When I choose :value from :field
156
+     */
157
+    public function iJobClassificationSelect($value,$field)
158
+    {
159
+        $field = Inflector::camelize($field);
160 160
 		
161
-		$mapSelect2 = [
162
-			'professions' => '#classifications-professions-span .select2-container',
163
-			'industries'  => '#classifications-industries-span .select2-container',
164
-			'employmentTypes' => '#classifications-employmentTypes-span .select2-container',
165
-		];
161
+        $mapSelect2 = [
162
+            'professions' => '#classifications-professions-span .select2-container',
163
+            'industries'  => '#classifications-industries-span .select2-container',
164
+            'employmentTypes' => '#classifications-employmentTypes-span .select2-container',
165
+        ];
166 166
 		
167
-		$mapMultiple = [
168
-			'professions'       => "select#classifications-professions",
169
-			'industries'        => "select#classifications-industries",
170
-			'employmentTypes'    => "select#classifications-employmentTypes",
171
-		];
167
+        $mapMultiple = [
168
+            'professions'       => "select#classifications-professions",
169
+            'industries'        => "select#classifications-industries",
170
+            'employmentTypes'    => "select#classifications-employmentTypes",
171
+        ];
172 172
 		
173
-		if(!isset($mapSelect2[$field])){
174
-			throw new \Exception('Undefined field selection value "'.$field.'"');
175
-		}
173
+        if(!isset($mapSelect2[$field])){
174
+            throw new \Exception('Undefined field selection value "'.$field.'"');
175
+        }
176 176
 		
177
-		$multipleField = $mapMultiple[$field];
178
-		$page = $this->minkContext->getSession()->getPage();
179
-		$element = $page->find('css',$mapMultiple[$field]);
180
-		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
181
-			$this->minkContext->selectOption($value,$multipleField);
182
-		}else{
183
-			$locator = $mapSelect2[$field];
184
-			$this->select2Context->iFillInSelect2Field($locator,$value);
185
-		}
186
-	}
177
+        $multipleField = $mapMultiple[$field];
178
+        $page = $this->minkContext->getSession()->getPage();
179
+        $element = $page->find('css',$mapMultiple[$field]);
180
+        if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
181
+            $this->minkContext->selectOption($value,$multipleField);
182
+        }else{
183
+            $locator = $mapSelect2[$field];
184
+            $this->select2Context->iFillInSelect2Field($locator,$value);
185
+        }
186
+    }
187 187
 	
188
-	/**
189
-	 * @return JobRepository
190
-	 */
191
-	public function getJobRepository()
192
-	{
193
-		return $this->getRepository('Jobs/Job');
194
-	}
188
+    /**
189
+     * @return JobRepository
190
+     */
191
+    public function getJobRepository()
192
+    {
193
+        return $this->getRepository('Jobs/Job');
194
+    }
195 195
 	
196
-	/**
197
-	 * @return CategoriesRepo
198
-	 */
199
-	public function getCategoriesRepository()
200
-	{
201
-		return $this->getRepository('Jobs/Category');
202
-	}
196
+    /**
197
+     * @return CategoriesRepo
198
+     */
199
+    public function getCategoriesRepository()
200
+    {
201
+        return $this->getRepository('Jobs/Category');
202
+    }
203 203
 	
204
-	/**
205
-	 * @When I have a :status job with the following:
206
-	 * @param TableNode $fields
207
-	 */
208
-	public function iHaveAJobWithTheFollowing($status,TableNode $fields)
209
-	{
210
-		$normalizedField = [
211
-			'template' => 'modern',
212
-		];
213
-		foreach($fields->getRowsHash() as $field => $value){
214
-			$field = Inflector::camelize($field);
215
-			if($field == 'professions' || $field == 'industries'){
216
-				$value = explode(',',$value);
217
-			}
218
-			$normalizedField[$field] = $value;
219
-		}
220
-		$jobRepo = $this->getJobRepository();
221
-		$job = $jobRepo->findOneBy(['title' => $normalizedField['title']]);
222
-		if(!$job instanceof Job){
223
-			$job = new Job();
224
-			$job->setTitle($normalizedField['title']);
225
-		}
226
-		if(isset($normalizedField['user'])){
227
-			/* @var $userRepo UserRepository */
228
-			$userRepo = $this->getRepository('Auth\Entity\User');
229
-			$user = $userRepo->findOneBy(['login' => $normalizedField['user']]);
230
-			if($user instanceof User){
231
-				$job->setUser($user);
232
-				$job->setOrganization($user->getOrganization()->getOrganization());
233
-			}else{
234
-				throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
235
-			}
236
-		}
204
+    /**
205
+     * @When I have a :status job with the following:
206
+     * @param TableNode $fields
207
+     */
208
+    public function iHaveAJobWithTheFollowing($status,TableNode $fields)
209
+    {
210
+        $normalizedField = [
211
+            'template' => 'modern',
212
+        ];
213
+        foreach($fields->getRowsHash() as $field => $value){
214
+            $field = Inflector::camelize($field);
215
+            if($field == 'professions' || $field == 'industries'){
216
+                $value = explode(',',$value);
217
+            }
218
+            $normalizedField[$field] = $value;
219
+        }
220
+        $jobRepo = $this->getJobRepository();
221
+        $job = $jobRepo->findOneBy(['title' => $normalizedField['title']]);
222
+        if(!$job instanceof Job){
223
+            $job = new Job();
224
+            $job->setTitle($normalizedField['title']);
225
+        }
226
+        if(isset($normalizedField['user'])){
227
+            /* @var $userRepo UserRepository */
228
+            $userRepo = $this->getRepository('Auth\Entity\User');
229
+            $user = $userRepo->findOneBy(['login' => $normalizedField['user']]);
230
+            if($user instanceof User){
231
+                $job->setUser($user);
232
+                $job->setOrganization($user->getOrganization()->getOrganization());
233
+            }else{
234
+                throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
235
+            }
236
+        }
237 237
 		
238
-		if($status == 'draft'){
239
-			$job->setIsDraft(true);
240
-		}elseif($status == 'published'){
241
-			$job->setIsDraft(false);
242
-			$job->setDatePublishStart(new \DateTime());
243
-		}
244
-		$job->setStatus(Status::ACTIVE);
238
+        if($status == 'draft'){
239
+            $job->setIsDraft(true);
240
+        }elseif($status == 'published'){
241
+            $job->setIsDraft(false);
242
+            $job->setDatePublishStart(new \DateTime());
243
+        }
244
+        $job->setStatus(Status::ACTIVE);
245 245
 		
246
-		if(isset($normalizedField['professions'])){
247
-			$this->addProfessions($job,$normalizedField['professions']);
248
-		}
246
+        if(isset($normalizedField['professions'])){
247
+            $this->addProfessions($job,$normalizedField['professions']);
248
+        }
249 249
 		
250
-		if(isset($normalizedField['industries'])){
251
-			$this->addIndustries($job,$normalizedField['industries']);
252
-		}
250
+        if(isset($normalizedField['industries'])){
251
+            $this->addIndustries($job,$normalizedField['industries']);
252
+        }
253 253
 		
254
-		if(isset($normalizedField['location'])){
255
-			$this->setLocation($job,$normalizedField['location']);
256
-		}
257
-		if(isset($normalizedField['employmentTypes'])){
258
-			$types = $this->getCategories([$normalizedField['employmentTypes']]);
259
-			$type = array_shift($types);
254
+        if(isset($normalizedField['location'])){
255
+            $this->setLocation($job,$normalizedField['location']);
256
+        }
257
+        if(isset($normalizedField['employmentTypes'])){
258
+            $types = $this->getCategories([$normalizedField['employmentTypes']]);
259
+            $type = array_shift($types);
260 260
 			
261
-			$job->getClassifications()->getEmploymentTypes()->getItems()->add($type);
262
-		}
263
-		if(isset($normalizedField['companyName'])){
264
-			$job->setCompany($normalizedField['companyName']);
265
-		}
261
+            $job->getClassifications()->getEmploymentTypes()->getItems()->add($type);
262
+        }
263
+        if(isset($normalizedField['companyName'])){
264
+            $job->setCompany($normalizedField['companyName']);
265
+        }
266 266
 		
267
-		$jobRepo->store($job);
268
-		$this->currentJob = $job;
269
-	}
267
+        $jobRepo->store($job);
268
+        $this->currentJob = $job;
269
+    }
270 270
 	
271
-	private function setLocation(Job $job, $term)
272
-	{
273
-		/* @var $client Photon */
274
-		$client = $this->coreContext->getServiceManager()->get('Geo/Client');
275
-		$result = $client->queryOne($term);
276
-		$location = new Location();
277
-		$serialized = Json::encode($result);
278
-		$location->fromString($serialized);
271
+    private function setLocation(Job $job, $term)
272
+    {
273
+        /* @var $client Photon */
274
+        $client = $this->coreContext->getServiceManager()->get('Geo/Client');
275
+        $result = $client->queryOne($term);
276
+        $location = new Location();
277
+        $serialized = Json::encode($result);
278
+        $location->fromString($serialized);
279 279
 		
280
-		$locations = $job->getLocations();
281
-		if(count($locations)){
282
-			$locations->clear();
283
-		}
284
-		$job->getLocations()->add($location);
285
-	}
280
+        $locations = $job->getLocations();
281
+        if(count($locations)){
282
+            $locations->clear();
283
+        }
284
+        $job->getLocations()->add($location);
285
+    }
286 286
 	
287
-	private function addProfessions(Job $job,$terms)
288
-	{
289
-		$professions = $this->getCategories($terms);
290
-		foreach($professions as $profession){
291
-			$job->getClassifications()->getProfessions()->getItems()->add($profession);
292
-		}
293
-	}
287
+    private function addProfessions(Job $job,$terms)
288
+    {
289
+        $professions = $this->getCategories($terms);
290
+        foreach($professions as $profession){
291
+            $job->getClassifications()->getProfessions()->getItems()->add($profession);
292
+        }
293
+    }
294 294
 	
295
-	private function addIndustries(Job $job, $terms)
296
-	{
297
-		$industries = $this->getCategories($terms);
298
-		foreach($industries as $industry){
299
-			$job->getClassifications()->getIndustries()->getItems()->add($industry);
300
-		}
301
-	}
295
+    private function addIndustries(Job $job, $terms)
296
+    {
297
+        $industries = $this->getCategories($terms);
298
+        foreach($industries as $industry){
299
+            $job->getClassifications()->getIndustries()->getItems()->add($industry);
300
+        }
301
+    }
302 302
 	
303
-	/**
304
-	 * @param array $categories
305
-	 *
306
-	 * @return mixed
307
-	 */
308
-	private function getCategories(array $categories)
309
-	{
310
-		$catRepo = $this->getCategoriesRepository();
303
+    /**
304
+     * @param array $categories
305
+     *
306
+     * @return mixed
307
+     */
308
+    private function getCategories(array $categories)
309
+    {
310
+        $catRepo = $this->getCategoriesRepository();
311 311
 		
312
-		// get a professions
313
-		$qb = $catRepo->createQueryBuilder()
314
-		              ->field('name')->in($categories)
315
-		              ->getQuery()
316
-		;
317
-		$results = $qb->execute();
318
-		return $results->toArray();
319
-	}
312
+        // get a professions
313
+        $qb = $catRepo->createQueryBuilder()
314
+                        ->field('name')->in($categories)
315
+                        ->getQuery()
316
+        ;
317
+        $results = $qb->execute();
318
+        return $results->toArray();
319
+    }
320 320
 	
321
-	/**
322
-	 * @return Job
323
-	 */
324
-	private function getCurrentUserJobDraft($jobTitle)
325
-	{
326
-		$repo = $this->getJobRepository();
327
-		$user = $this->getCurrentUser();
321
+    /**
322
+     * @return Job
323
+     */
324
+    private function getCurrentUserJobDraft($jobTitle)
325
+    {
326
+        $repo = $this->getJobRepository();
327
+        $user = $this->getCurrentUser();
328 328
 		
329
-		$job = $repo->findDraft($user);
329
+        $job = $repo->findDraft($user);
330 330
 		
331
-		if(is_null($job)){
332
-			$job = new Job();
333
-			$job
334
-				->setUser($user)
335
-				->setOrganization($user->getOrganization()->getOrganization())
336
-				->setStatus(StatusInterface::CREATED)
337
-			;
338
-			$job->setIsDraft(true);
339
-		}
340
-		$job->setTitle($jobTitle);
341
-		$repo->store($job);
342
-		return $job;
343
-	}
331
+        if(is_null($job)){
332
+            $job = new Job();
333
+            $job
334
+                ->setUser($user)
335
+                ->setOrganization($user->getOrganization()->getOrganization())
336
+                ->setStatus(StatusInterface::CREATED)
337
+            ;
338
+            $job->setIsDraft(true);
339
+        }
340
+        $job->setTitle($jobTitle);
341
+        $repo->store($job);
342
+        return $job;
343
+    }
344 344
 }
345 345
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	public function iGoToEditJobWithTitle($jobTitle)
109 109
 	{
110 110
 		$job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
111
-		if(!$job instanceof Job){
112
-			throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
111
+		if (!$job instanceof Job) {
112
+			throw new \Exception(sprintf('Job with title "%s" is not found', $jobTitle));
113 113
 		}
114 114
 		$this->currentJob = $job;
115 115
 		$url = '/en/jobs/edit?id='.$job->getId();
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 		$user = $this->getCurrentUser();
136 136
 		$jobRepository = $this->getJobRepository();
137 137
 		$results = $jobRepository->getUserJobs($user->getId());
138
-		foreach($results as $job){
139
-			$jobRepository->remove($job,true);
138
+		foreach ($results as $job) {
139
+			$jobRepository->remove($job, true);
140 140
 		}
141 141
 		$this->currentJob = null;
142 142
 	}
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
 	 * @When I fill job location search with :search and choose :choice
146 146
 	 *
147 147
 	 */
148
-	public function iFillJobLocationAndChoose($search,$choice)
148
+	public function iFillJobLocationAndChoose($search, $choice)
149 149
 	{
150 150
 		$select2 = $this->select2Context;
151
-		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
151
+		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]', $search, $choice);
152 152
 	}
153 153
 	
154 154
 	/**
155 155
 	 * @When I choose :value from :field
156 156
 	 */
157
-	public function iJobClassificationSelect($value,$field)
157
+	public function iJobClassificationSelect($value, $field)
158 158
 	{
159 159
 		$field = Inflector::camelize($field);
160 160
 		
@@ -170,18 +170,18 @@  discard block
 block discarded – undo
170 170
 			'employmentTypes'    => "select#classifications-employmentTypes",
171 171
 		];
172 172
 		
173
-		if(!isset($mapSelect2[$field])){
173
+		if (!isset($mapSelect2[$field])) {
174 174
 			throw new \Exception('Undefined field selection value "'.$field.'"');
175 175
 		}
176 176
 		
177 177
 		$multipleField = $mapMultiple[$field];
178 178
 		$page = $this->minkContext->getSession()->getPage();
179
-		$element = $page->find('css',$mapMultiple[$field]);
180
-		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
181
-			$this->minkContext->selectOption($value,$multipleField);
182
-		}else{
179
+		$element = $page->find('css', $mapMultiple[$field]);
180
+		if (!is_null($element) && $element->getAttribute('multiple') == 'multiple') {
181
+			$this->minkContext->selectOption($value, $multipleField);
182
+		} else {
183 183
 			$locator = $mapSelect2[$field];
184
-			$this->select2Context->iFillInSelect2Field($locator,$value);
184
+			$this->select2Context->iFillInSelect2Field($locator, $value);
185 185
 		}
186 186
 	}
187 187
 	
@@ -205,62 +205,62 @@  discard block
 block discarded – undo
205 205
 	 * @When I have a :status job with the following:
206 206
 	 * @param TableNode $fields
207 207
 	 */
208
-	public function iHaveAJobWithTheFollowing($status,TableNode $fields)
208
+	public function iHaveAJobWithTheFollowing($status, TableNode $fields)
209 209
 	{
210 210
 		$normalizedField = [
211 211
 			'template' => 'modern',
212 212
 		];
213
-		foreach($fields->getRowsHash() as $field => $value){
213
+		foreach ($fields->getRowsHash() as $field => $value) {
214 214
 			$field = Inflector::camelize($field);
215
-			if($field == 'professions' || $field == 'industries'){
216
-				$value = explode(',',$value);
215
+			if ($field == 'professions' || $field == 'industries') {
216
+				$value = explode(',', $value);
217 217
 			}
218 218
 			$normalizedField[$field] = $value;
219 219
 		}
220 220
 		$jobRepo = $this->getJobRepository();
221 221
 		$job = $jobRepo->findOneBy(['title' => $normalizedField['title']]);
222
-		if(!$job instanceof Job){
222
+		if (!$job instanceof Job) {
223 223
 			$job = new Job();
224 224
 			$job->setTitle($normalizedField['title']);
225 225
 		}
226
-		if(isset($normalizedField['user'])){
226
+		if (isset($normalizedField['user'])) {
227 227
 			/* @var $userRepo UserRepository */
228 228
 			$userRepo = $this->getRepository('Auth\Entity\User');
229 229
 			$user = $userRepo->findOneBy(['login' => $normalizedField['user']]);
230
-			if($user instanceof User){
230
+			if ($user instanceof User) {
231 231
 				$job->setUser($user);
232 232
 				$job->setOrganization($user->getOrganization()->getOrganization());
233
-			}else{
233
+			} else {
234 234
 				throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
235 235
 			}
236 236
 		}
237 237
 		
238
-		if($status == 'draft'){
238
+		if ($status == 'draft') {
239 239
 			$job->setIsDraft(true);
240
-		}elseif($status == 'published'){
240
+		}elseif ($status == 'published') {
241 241
 			$job->setIsDraft(false);
242 242
 			$job->setDatePublishStart(new \DateTime());
243 243
 		}
244 244
 		$job->setStatus(Status::ACTIVE);
245 245
 		
246
-		if(isset($normalizedField['professions'])){
247
-			$this->addProfessions($job,$normalizedField['professions']);
246
+		if (isset($normalizedField['professions'])) {
247
+			$this->addProfessions($job, $normalizedField['professions']);
248 248
 		}
249 249
 		
250
-		if(isset($normalizedField['industries'])){
251
-			$this->addIndustries($job,$normalizedField['industries']);
250
+		if (isset($normalizedField['industries'])) {
251
+			$this->addIndustries($job, $normalizedField['industries']);
252 252
 		}
253 253
 		
254
-		if(isset($normalizedField['location'])){
255
-			$this->setLocation($job,$normalizedField['location']);
254
+		if (isset($normalizedField['location'])) {
255
+			$this->setLocation($job, $normalizedField['location']);
256 256
 		}
257
-		if(isset($normalizedField['employmentTypes'])){
257
+		if (isset($normalizedField['employmentTypes'])) {
258 258
 			$types = $this->getCategories([$normalizedField['employmentTypes']]);
259 259
 			$type = array_shift($types);
260 260
 			
261 261
 			$job->getClassifications()->getEmploymentTypes()->getItems()->add($type);
262 262
 		}
263
-		if(isset($normalizedField['companyName'])){
263
+		if (isset($normalizedField['companyName'])) {
264 264
 			$job->setCompany($normalizedField['companyName']);
265 265
 		}
266 266
 		
@@ -278,16 +278,16 @@  discard block
 block discarded – undo
278 278
 		$location->fromString($serialized);
279 279
 		
280 280
 		$locations = $job->getLocations();
281
-		if(count($locations)){
281
+		if (count($locations)) {
282 282
 			$locations->clear();
283 283
 		}
284 284
 		$job->getLocations()->add($location);
285 285
 	}
286 286
 	
287
-	private function addProfessions(Job $job,$terms)
287
+	private function addProfessions(Job $job, $terms)
288 288
 	{
289 289
 		$professions = $this->getCategories($terms);
290
-		foreach($professions as $profession){
290
+		foreach ($professions as $profession) {
291 291
 			$job->getClassifications()->getProfessions()->getItems()->add($profession);
292 292
 		}
293 293
 	}
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	private function addIndustries(Job $job, $terms)
296 296
 	{
297 297
 		$industries = $this->getCategories($terms);
298
-		foreach($industries as $industry){
298
+		foreach ($industries as $industry) {
299 299
 			$job->getClassifications()->getIndustries()->getItems()->add($industry);
300 300
 		}
301 301
 	}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		
329 329
 		$job = $repo->findDraft($user);
330 330
 		
331
-		if(is_null($job)){
331
+		if (is_null($job)) {
332 332
 			$job = new Job();
333 333
 			$job
334 334
 				->setUser($user)
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		$element = $page->find('css',$mapMultiple[$field]);
180 180
 		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
181 181
 			$this->minkContext->selectOption($value,$multipleField);
182
-		}else{
182
+		} else{
183 183
 			$locator = $mapSelect2[$field];
184 184
 			$this->select2Context->iFillInSelect2Field($locator,$value);
185 185
 		}
@@ -230,14 +230,14 @@  discard block
 block discarded – undo
230 230
 			if($user instanceof User){
231 231
 				$job->setUser($user);
232 232
 				$job->setOrganization($user->getOrganization()->getOrganization());
233
-			}else{
233
+			} else{
234 234
 				throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
235 235
 			}
236 236
 		}
237 237
 		
238 238
 		if($status == 'draft'){
239 239
 			$job->setIsDraft(true);
240
-		}elseif($status == 'published'){
240
+		} elseif($status == 'published'){
241 241
 			$job->setIsDraft(false);
242 242
 			$job->setDatePublishStart(new \DateTime());
243 243
 		}
Please login to merge, or discard this patch.
module/Behat/src/SummaryFormContext.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -15,63 +15,63 @@
 block discarded – undo
15 15
 
16 16
 class SummaryFormContext implements Context
17 17
 {
18
-	use CommonContextTrait;
18
+    use CommonContextTrait;
19 19
 	
20
-	private $elementMap = array(
21
-		'name' => '#sf-nameForm',
22
-		'location' => '#sf-locationForm',
23
-		'employees' => '#sf-employeesManagement',
24
-		'workflow' => '#sf-workflowSettings',
25
-		'jobTitleAndLocation' => '#general-locationForm',
26
-		'jobClassification' => '#sf-general-classifications',
27
-		'customerNote' => '#sf-general-customerNote',
28
-		'personalInformations' => '#sf-contact-contact',
29
-		'resumePersonalInformations' => '#sf-contact',
30
-	);
20
+    private $elementMap = array(
21
+        'name' => '#sf-nameForm',
22
+        'location' => '#sf-locationForm',
23
+        'employees' => '#sf-employeesManagement',
24
+        'workflow' => '#sf-workflowSettings',
25
+        'jobTitleAndLocation' => '#general-locationForm',
26
+        'jobClassification' => '#sf-general-classifications',
27
+        'customerNote' => '#sf-general-customerNote',
28
+        'personalInformations' => '#sf-contact-contact',
29
+        'resumePersonalInformations' => '#sf-contact',
30
+    );
31 31
 	
32
-	/**
33
-	 * @When I click edit on :name form
34
-	 * @TODO: [ZF3] move this method to CoreContext
35
-	 */
36
-	public function iClickEditOnForm($name)
37
-	{
38
-		$this->iClickForm($name);
39
-		$name = Inflector::camelize($name);
40
-		$type = $this->elementMap[$name];
41
-		$locator = $type.' .sf-summary .sf-controls button';
42
-		$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
43
-		if(!$element){
44
-			throw new \Exception('No element found with this locator: "'.$locator.'"');
45
-		}
46
-		$element->click();
47
-	}
32
+    /**
33
+     * @When I click edit on :name form
34
+     * @TODO: [ZF3] move this method to CoreContext
35
+     */
36
+    public function iClickEditOnForm($name)
37
+    {
38
+        $this->iClickForm($name);
39
+        $name = Inflector::camelize($name);
40
+        $type = $this->elementMap[$name];
41
+        $locator = $type.' .sf-summary .sf-controls button';
42
+        $element = $this->minkContext->getSession()->getPage()->find('css',$locator);
43
+        if(!$element){
44
+            throw new \Exception('No element found with this locator: "'.$locator.'"');
45
+        }
46
+        $element->click();
47
+    }
48 48
 	
49
-	/**
50
-	 * @When I click :form form
51
-	 */
52
-	public function iClickForm($name)
53
-	{
54
-		$name = Inflector::camelize($name);
55
-		$type = $this->elementMap[$name];
56
-		$locator = $type.' .sf-summary';
57
-		$session = $this->minkContext->getSession();
58
-		$script = <<<EOC
49
+    /**
50
+     * @When I click :form form
51
+     */
52
+    public function iClickForm($name)
53
+    {
54
+        $name = Inflector::camelize($name);
55
+        $type = $this->elementMap[$name];
56
+        $locator = $type.' .sf-summary';
57
+        $session = $this->minkContext->getSession();
58
+        $script = <<<EOC
59 59
 var tElement = jQuery("$locator .sf-controls");
60 60
 tElement.css('display','block');
61 61
 tElement.css('visibility','visible');
62 62
 EOC;
63
-		$session->executeScript($script);
64
-	}
63
+        $session->executeScript($script);
64
+    }
65 65
 	
66
-	/**
67
-	 * @When I save :type form
68
-	 */
69
-	public function iSaveForm($type)
70
-	{
71
-		$type = Inflector::camelize($type);
72
-		$locator = $this->elementMap[$type].' button.sf-submit';
73
-		$this->coreContext->scrollIntoView($locator);
74
-		$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
75
-		$element->click();
76
-	}
66
+    /**
67
+     * @When I save :type form
68
+     */
69
+    public function iSaveForm($type)
70
+    {
71
+        $type = Inflector::camelize($type);
72
+        $locator = $this->elementMap[$type].' button.sf-submit';
73
+        $this->coreContext->scrollIntoView($locator);
74
+        $element = $this->minkContext->getSession()->getPage()->find('css',$locator);
75
+        $element->click();
76
+    }
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 		$name = Inflector::camelize($name);
40 40
 		$type = $this->elementMap[$name];
41 41
 		$locator = $type.' .sf-summary .sf-controls button';
42
-		$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
43
-		if(!$element){
42
+		$element = $this->minkContext->getSession()->getPage()->find('css', $locator);
43
+		if (!$element) {
44 44
 			throw new \Exception('No element found with this locator: "'.$locator.'"');
45 45
 		}
46 46
 		$element->click();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$type = Inflector::camelize($type);
72 72
 		$locator = $this->elementMap[$type].' button.sf-submit';
73 73
 		$this->coreContext->scrollIntoView($locator);
74
-		$element = $this->minkContext->getSession()->getPage()->find('css',$locator);
74
+		$element = $this->minkContext->getSession()->getPage()->find('css', $locator);
75 75
 		$element->click();
76 76
 	}
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
module/Behat/src/ApplicationContext.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,26 +22,26 @@
 block discarded – undo
22 22
  */
23 23
 class ApplicationContext implements Context
24 24
 {
25
-	use CommonContextTrait;
25
+    use CommonContextTrait;
26 26
 	
27
-	/**
28
-	 * @Given I apply for :title job
29
-	 *
30
-	 * @param string $title
31
-	 * @throws \Exception when the titled job not exists
32
-	 */
33
-	public function iApplyAJob($title)
34
-	{
35
-		/* @var $repo JobRepository */
36
-		$repo = $this->getRepository('Jobs/Job');
37
-		$job = $repo->findOneBy(['title' => $title]);
38
-		if(!$job instanceof Job){
39
-			throw new \Exception('There is no job titled: "'.$title.'"');
40
-		}
41
-		$job->setApplyId($job->getId());
42
-		$repo->store($job);
27
+    /**
28
+     * @Given I apply for :title job
29
+     *
30
+     * @param string $title
31
+     * @throws \Exception when the titled job not exists
32
+     */
33
+    public function iApplyAJob($title)
34
+    {
35
+        /* @var $repo JobRepository */
36
+        $repo = $this->getRepository('Jobs/Job');
37
+        $job = $repo->findOneBy(['title' => $title]);
38
+        if(!$job instanceof Job){
39
+            throw new \Exception('There is no job titled: "'.$title.'"');
40
+        }
41
+        $job->setApplyId($job->getId());
42
+        $repo->store($job);
43 43
 		
44
-		$url = '/en/apply/'.$job->getApplyId();
45
-		$this->visit($url);
46
-	}
44
+        $url = '/en/apply/'.$job->getApplyId();
45
+        $this->visit($url);
46
+    }
47 47
 }
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
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());
Please login to merge, or discard this patch.
module/Jobs/config/module.config.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
             'Jobs/ApiJobListByChannel' => 'Jobs\Controller\ApiJobListByChannelController',
275 275
         ],
276 276
         'factories' => [
277
-        	'Jobs/Console' => [ConsoleController::class,'factory'],
278
-	        'Jobs/AdminCategories' => [AdminCategoriesController::class,'factory'],
279
-	        'Jobs/Admin'      => [AdminController::class,'factory'],
277
+            'Jobs/Console' => [ConsoleController::class,'factory'],
278
+            'Jobs/AdminCategories' => [AdminCategoriesController::class,'factory'],
279
+            'Jobs/Admin'      => [AdminController::class,'factory'],
280 280
             'Jobs/Template' => 'Jobs\Factory\Controller\TemplateControllerFactory',
281 281
             'Jobs/Index' => 'Jobs\Factory\Controller\IndexControllerFactory',
282 282
             'Jobs/Approval' => 'Jobs\Factory\Controller\ApprovalControllerFactory',
@@ -428,15 +428,15 @@  discard block
 block discarded – undo
428 428
         'invokables' => [
429 429
             'Jobs/Location/New'                 => 'Jobs\Form\InputFilter\JobLocationNew',
430 430
             //'Jobs/Location/Edit'                => 'Jobs\Form\InputFilter\JobLocationEdit',
431
-	        JobLocationEdit::class => JobLocationEdit::class,
431
+            JobLocationEdit::class => JobLocationEdit::class,
432 432
             'Jobs/Company'                      => 'Jobs\Form\InputFilter\CompanyName',
433 433
         ],
434 434
         'factories' => [
435 435
             'Jobs/AtsMode'                      => 'Jobs\Factory\Form\InputFilter\AtsModeFactory',
436 436
         ],
437
-	    'aliases' => [
438
-	    	'Jobs/Location/Edit' => JobLocationEdit::class
439
-	    ]
437
+        'aliases' => [
438
+            'Jobs/Location/Edit' => JobLocationEdit::class
439
+        ]
440 440
     ],
441 441
 
442 442
     'filters' => [
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
                  * for multiple paths.
22 22
                  * example https://github.com/doctrine/DoctrineORMModule
23 23
                  */
24
-                'paths' => [ __DIR__ . '/../src/Jobs/Entity'],
24
+                'paths' => [__DIR__.'/../src/Jobs/Entity'],
25 25
             ],
26 26
         ],
27 27
         'eventmanager' => [
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
     ],
35 35
 
36 36
     'options' => [
37
-        'Jobs/JobboardSearchOptions' => [ 'class' => '\Jobs\Options\JobboardSearchOptions' ],
38
-        'Jobs/BaseFieldsetOptions' => [ 'class' => '\Jobs\Options\BaseFieldsetOptions' ],
37
+        'Jobs/JobboardSearchOptions' => ['class' => '\Jobs\Options\JobboardSearchOptions'],
38
+        'Jobs/BaseFieldsetOptions' => ['class' => '\Jobs\Options\BaseFieldsetOptions'],
39 39
     ],
40 40
 
41 41
     'Jobs' => [
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             'translation_file_patterns' => [
58 58
                     [
59 59
                             'type'     => 'gettext',
60
-                            'base_dir' => __DIR__ . '/../language',
60
+                            'base_dir' => __DIR__.'/../language',
61 61
                             'pattern'  => '%s.mo',
62 62
                     ],
63 63
             ],
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                     'Jobboard',
98 98
                     'Jobs/Jobboard',
99 99
                     'Jobs/ApiJobListByChannel',
100
-                    'Jobs/Template' => [ 'view', 'edittemplate' ],
100
+                    'Jobs/Template' => ['view', 'edittemplate'],
101 101
                     'Jobs/Manage' => [
102 102
                         'template',
103 103
                     ],
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             'Jobs/Listener/AdminWidgetProvider'           => 'Jobs\Factory\Listener\AdminWidgetProviderFactory',
223 223
             'Jobs/ViewModelTemplateFilter'                => 'Jobs\Factory\Filter\ViewModelTemplateFilterFactory',
224 224
             'Jobs\Model\ApiJobDehydrator'                 => 'Jobs\Factory\Model\ApiJobDehydratorFactory',
225
-            'Jobs/Listener/Publisher'                     => [Publisher::class,'factory'],
225
+            'Jobs/Listener/Publisher'                     => [Publisher::class, 'factory'],
226 226
             'Jobs/PreviewLinkHydrator'                    => 'Jobs\Form\Hydrator\PreviewLinkHydrator::factory',
227 227
             'Jobs\Auth\Dependency\ListListener'           => 'Jobs\Factory\Auth\Dependency\ListListenerFactory',
228 228
             'Jobs/DefaultCategoriesBuilder'              => 'Jobs\Factory\Repository\DefaultCategoriesBuilderFactory',
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 
241 241
     'event_manager' => [
242
-        'Core/AdminController/Events' => [ 'listeners' => [
242
+        'Core/AdminController/Events' => ['listeners' => [
243 243
             'Jobs/Listener/AdminWidgetProvider' => \Core\Controller\AdminControllerEvent::EVENT_DASHBOARD,
244 244
         ]],
245 245
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         'Core/Ajax/Events' => ['listeners' => [
262 262
             \Jobs\Listener\DeleteJob::class => ['jobs.delete', true],
263 263
             \Jobs\Listener\GetOrganizationManagers::class => ['jobs.manager-select', true],
264
-            \Jobs\Listener\LoadActiveOrganizations::class => [ 'jobs.admin.activeorganizations', true],
264
+            \Jobs\Listener\LoadActiveOrganizations::class => ['jobs.admin.activeorganizations', true],
265 265
 
266 266
         ]],
267 267
     ],
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
             'Jobs/ApiJobListByChannel' => 'Jobs\Controller\ApiJobListByChannelController',
275 275
         ],
276 276
         'factories' => [
277
-        	'Jobs/Console' => [ConsoleController::class,'factory'],
278
-	        'Jobs/AdminCategories' => [AdminCategoriesController::class,'factory'],
279
-	        'Jobs/Admin'      => [AdminController::class,'factory'],
277
+        	'Jobs/Console' => [ConsoleController::class, 'factory'],
278
+	        'Jobs/AdminCategories' => [AdminCategoriesController::class, 'factory'],
279
+	        'Jobs/Admin'      => [AdminController::class, 'factory'],
280 280
             'Jobs/Template' => 'Jobs\Factory\Controller\TemplateControllerFactory',
281 281
             'Jobs/Index' => 'Jobs\Factory\Controller\IndexControllerFactory',
282 282
             'Jobs/Approval' => 'Jobs\Factory\Controller\ApprovalControllerFactory',
@@ -309,41 +309,41 @@  discard block
 block discarded – undo
309 309
     'view_manager' => [
310 310
         // Map template to files. Speeds up the lookup through the template stack.
311 311
         'template_map' => [
312
-            'jobs/form/list-filter' => __DIR__ . '/../view/form/list-filter.phtml',
313
-            'jobs/form/apply-identifier' => __DIR__ . '/../view/form/apply-identifier.phtml',
314
-            'jobs/form/hiring-organization-select' => __DIR__ . '/../view/form/hiring-organization-select.phtml',
315
-            'jobs/form/multiposting-select' => __DIR__ . '/../view/form/multiposting-select.phtml',
316
-            'jobs/form/multiposting-checkboxes' => __DIR__ . '/../view/form/multiposting-checkboxes.phtml',
317
-            'jobs/form/ats-mode.view' => __DIR__ . '/../view/form/ats-mode.view.phtml',
318
-            'jobs/form/ats-mode.form' => __DIR__ . '/../view/form/ats-mode.form.phtml',
319
-            'jobs/form/company-name-fieldset' => __DIR__ . '/../view/form/company-name-fieldset.phtml',
320
-            'jobs/form/preview' => __DIR__ . '/../view/form/preview.phtml',
321
-            'jobs/form/customer-note' => __DIR__ . '/../view/form/customer-note.phtml',
322
-            'jobs/partials/channel-list' => __DIR__ . '/../view/partials/channel-list.phtml',
323
-            'jobs/assign-user' => __DIR__ . '/../view/jobs/manage/assign-user.phtml',
324
-            'jobs/snapshot_or_preview' => __DIR__ . '/../view/partials/snapshot_or_preview.phtml',
325
-            'jobs/history' => __DIR__ . '/../view/partials/history.phtml',
326
-            'jobs/portalsummary' => __DIR__ . '/../view/partials/portalsummary.phtml',
327
-            'content/jobs-publish-on-yawik' => __DIR__ . '/../view/modals/yawik.phtml',
328
-            'content/jobs-publish-on-jobsintown' => __DIR__ . '/../view/modals/jobsintown.phtml',
329
-            'content/jobs-publish-on-homepage' => __DIR__ . '/../view/modals/homepage.phtml',
330
-            'content/jobs-publish-on-fazjob' => __DIR__ . '/../view/modals/fazjob.phtml',
331
-            'content/jobs-terms-and-conditions' => __DIR__ . '/../view/jobs/index/terms.phtml',
332
-            'mail/job-created' => __DIR__ . '/../view/mails/job-created.phtml',
333
-            'mail/job-pending' => __DIR__ . '/../view/mails/job-pending.phtml',
334
-            'mail/job-accepted' => __DIR__ . '/../view/mails/job-accepted.phtml',
335
-            'mail/job-rejected' => __DIR__ . '/../view/mails/job-rejected.phtml',
336
-            'mail/job-created.en' => __DIR__ . '/../view/mails/job-created.en.phtml',
337
-            'mail/job-pending.en' => __DIR__ . '/../view/mails/job-pending.en.phtml',
338
-            'mail/job-accepted.en' => __DIR__ . '/../view/mails/job-accepted.en.phtml',
339
-            'mail/job-rejected.en' => __DIR__ . '/../view/mails/job-rejected.en.phtml',
340
-            'jobs/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml',
341
-            'jobs/error/expired' => __DIR__ . '/../view/error/expired.phtml',
312
+            'jobs/form/list-filter' => __DIR__.'/../view/form/list-filter.phtml',
313
+            'jobs/form/apply-identifier' => __DIR__.'/../view/form/apply-identifier.phtml',
314
+            'jobs/form/hiring-organization-select' => __DIR__.'/../view/form/hiring-organization-select.phtml',
315
+            'jobs/form/multiposting-select' => __DIR__.'/../view/form/multiposting-select.phtml',
316
+            'jobs/form/multiposting-checkboxes' => __DIR__.'/../view/form/multiposting-checkboxes.phtml',
317
+            'jobs/form/ats-mode.view' => __DIR__.'/../view/form/ats-mode.view.phtml',
318
+            'jobs/form/ats-mode.form' => __DIR__.'/../view/form/ats-mode.form.phtml',
319
+            'jobs/form/company-name-fieldset' => __DIR__.'/../view/form/company-name-fieldset.phtml',
320
+            'jobs/form/preview' => __DIR__.'/../view/form/preview.phtml',
321
+            'jobs/form/customer-note' => __DIR__.'/../view/form/customer-note.phtml',
322
+            'jobs/partials/channel-list' => __DIR__.'/../view/partials/channel-list.phtml',
323
+            'jobs/assign-user' => __DIR__.'/../view/jobs/manage/assign-user.phtml',
324
+            'jobs/snapshot_or_preview' => __DIR__.'/../view/partials/snapshot_or_preview.phtml',
325
+            'jobs/history' => __DIR__.'/../view/partials/history.phtml',
326
+            'jobs/portalsummary' => __DIR__.'/../view/partials/portalsummary.phtml',
327
+            'content/jobs-publish-on-yawik' => __DIR__.'/../view/modals/yawik.phtml',
328
+            'content/jobs-publish-on-jobsintown' => __DIR__.'/../view/modals/jobsintown.phtml',
329
+            'content/jobs-publish-on-homepage' => __DIR__.'/../view/modals/homepage.phtml',
330
+            'content/jobs-publish-on-fazjob' => __DIR__.'/../view/modals/fazjob.phtml',
331
+            'content/jobs-terms-and-conditions' => __DIR__.'/../view/jobs/index/terms.phtml',
332
+            'mail/job-created' => __DIR__.'/../view/mails/job-created.phtml',
333
+            'mail/job-pending' => __DIR__.'/../view/mails/job-pending.phtml',
334
+            'mail/job-accepted' => __DIR__.'/../view/mails/job-accepted.phtml',
335
+            'mail/job-rejected' => __DIR__.'/../view/mails/job-rejected.phtml',
336
+            'mail/job-created.en' => __DIR__.'/../view/mails/job-created.en.phtml',
337
+            'mail/job-pending.en' => __DIR__.'/../view/mails/job-pending.en.phtml',
338
+            'mail/job-accepted.en' => __DIR__.'/../view/mails/job-accepted.en.phtml',
339
+            'mail/job-rejected.en' => __DIR__.'/../view/mails/job-rejected.en.phtml',
340
+            'jobs/error/no-parent' => __DIR__.'/../view/error/no-parent.phtml',
341
+            'jobs/error/expired' => __DIR__.'/../view/error/expired.phtml',
342 342
         ],
343 343
 
344 344
         // Where to look for view templates not mapped above
345 345
         'template_path_stack' => [
346
-            __DIR__ . '/../view',
346
+            __DIR__.'/../view',
347 347
         ],
348 348
     ],
349 349
 
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Listener/Publisher.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -171,13 +171,13 @@
 block discarded – undo
171 171
                     $response_externalIdUpdate = $decodedBody->applyIdUpdate;
172 172
 
173 173
                     if ($publisher->externalId != $response_externalIdUpdate || $publisher->reference != $response_referenceUpdate) {
174
-                    	$logInfo = 'RestCall changed externalID ['
175
-	                               . var_export($publisher->externalId, true)
176
-	                               . ' => '
177
-	                               . var_export($response_externalIdUpdate, true) . '], reference  ['
178
-	                               . var_export($publisher->reference, true)
179
-	                               . ' => '
180
-	                               . var_export($response_referenceUpdate, true) . ']';
174
+                        $logInfo = 'RestCall changed externalID ['
175
+                                    . var_export($publisher->externalId, true)
176
+                                    . ' => '
177
+                                    . var_export($response_externalIdUpdate, true) . '], reference  ['
178
+                                    . var_export($publisher->reference, true)
179
+                                    . ' => '
180
+                                    . var_export($response_referenceUpdate, true) . ']';
181 181
                         $log->info($logInfo);
182 182
                         $publisher->reference = $response_referenceUpdate;
183 183
                         $publisher->externalId = $response_externalIdUpdate;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param EventManagerInterface $events
47 47
      * @return $this
48 48
      */
49
-    public function attach(EventManagerInterface $events, $priority=1)
49
+    public function attach(EventManagerInterface $events, $priority = 1)
50 50
     {
51 51
         return $this;
52 52
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 $jsonLastError = json_last_error();
165 165
                 if (json_last_error() != JSON_ERROR_NONE) {
166 166
                     // not able to decode json
167
-                    $log->info('RestCall Response not Json [errorCode: ' . $jsonLastError . ']: ' . var_export($body, true));
167
+                    $log->info('RestCall Response not Json [errorCode: '.$jsonLastError.']: '.var_export($body, true));
168 168
                 } else {
169 169
                     // does the provider want to have an own ID for Identification ?
170 170
                     $response_referenceUpdate = $decodedBody->referenceUpdate;
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
                     	$logInfo = 'RestCall changed externalID ['
175 175
 	                               . var_export($publisher->externalId, true)
176 176
 	                               . ' => '
177
-	                               . var_export($response_externalIdUpdate, true) . '], reference  ['
177
+	                               . var_export($response_externalIdUpdate, true).'], reference  ['
178 178
 	                               . var_export($publisher->reference, true)
179 179
 	                               . ' => '
180
-	                               . var_export($response_referenceUpdate, true) . ']';
180
+	                               . var_export($response_referenceUpdate, true).']';
181 181
                         $log->info($logInfo);
182 182
                         $publisher->reference = $response_referenceUpdate;
183 183
                         $publisher->externalId = $response_externalIdUpdate;
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Listener/MailSender.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function onJobAccepted(JobEvent $e)
108 108
     {
109
-    	$target = $e->getTarget();
109
+        $target = $e->getTarget();
110 110
     	
111 111
         $this->sendMail(
112 112
             $target->getJobEntity(),
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
     {
142 142
         $mail = $this->mailer->get('htmltemplate');
143 143
         $mail->setTemplate($template)
144
-             ->setSubject($subject)
145
-             ->setVariables(
146
-                 array(
144
+                ->setSubject($subject)
145
+                ->setVariables(
146
+                    array(
147 147
                                 'job'      => $job,
148 148
                                 'siteName' => $this->options['siteName'],
149 149
                             )
150
-             );
150
+                );
151 151
 
152 152
         if ($adminMail) {
153 153
             $mail->setTo($this->options['adminEmail']);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $this->options = array_merge($this->options, $options);
63 63
     }
64 64
 
65
-    public function attach(EventManagerInterface $events, $priority=1)
65
+    public function attach(EventManagerInterface $events, $priority = 1)
66 66
     {
67 67
         $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_CREATED, array($this, 'onJobCreated'));
68 68
         $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_ACCEPTED, array($this, 'onJobAccepted'));
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Factory/Filter/ViewModelTemplateFilterFactory.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -31,54 +31,54 @@
 block discarded – undo
31 31
  */
32 32
 class ViewModelTemplateFilterFactory implements FactoryInterface
33 33
 {
34
-	/**
35
-	 * @var ServiceLocatorInterface
36
-	 */
37
-	protected $service;
34
+    /**
35
+     * @var ServiceLocatorInterface
36
+     */
37
+    protected $service;
38 38
 	
39
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
40
-	{
41
-		$this->service = $container;
42
-		return $this;
43
-	}
39
+    public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
40
+    {
41
+        $this->service = $container;
42
+        return $this;
43
+    }
44 44
 	
45
-	/**
46
-	 * @param $element
47
-	 * @return \Zend\View\Model\ViewModel
48
-	 * @throws \InvalidArgumentException
49
-	 * @TODO: [ZF3] renamed this method into getModel because conflict with FactoryInterface::__invoke() method
50
-	 */
51
-	public function getModel($element)
52
-	{
53
-		$filter = null;
54
-		if ($element instanceof EntityInterface) {
55
-			$filter = new ViewModelTemplateFilterJob;
56
-		}
57
-		if ($element instanceof Element) {
58
-			$filter = new ViewModelTemplateFilterForm;
59
-			$viewHelperManager = $this->service->get('ViewHelperManager');
60
-			$viewHelperForm = $viewHelperManager->get('formSimple');
61
-			$filter->setViewHelperForm($viewHelperForm);
62
-		}
63
-		if (!isset($filter)) {
64
-			throw new \InvalidArgumentException(get_class($element) . ' cannot be used to initialize a template');
65
-		}
66
-		$viewManager = $this->service->get('ViewHelperManager');
67
-		$basePathHelper = $viewManager->get('basePath');
68
-		$serverUrlHelper = $viewManager->get('serverUrl');
69
-		$imageFileCacheHelper = $this->service->get('Organizations\ImageFileCache\Manager');
70
-		$filter->setBasePathHelper($basePathHelper);
71
-		$filter->setImageFileCacheHelper($imageFileCacheHelper);
72
-		$filter->setServerUrlHelper($serverUrlHelper);
45
+    /**
46
+     * @param $element
47
+     * @return \Zend\View\Model\ViewModel
48
+     * @throws \InvalidArgumentException
49
+     * @TODO: [ZF3] renamed this method into getModel because conflict with FactoryInterface::__invoke() method
50
+     */
51
+    public function getModel($element)
52
+    {
53
+        $filter = null;
54
+        if ($element instanceof EntityInterface) {
55
+            $filter = new ViewModelTemplateFilterJob;
56
+        }
57
+        if ($element instanceof Element) {
58
+            $filter = new ViewModelTemplateFilterForm;
59
+            $viewHelperManager = $this->service->get('ViewHelperManager');
60
+            $viewHelperForm = $viewHelperManager->get('formSimple');
61
+            $filter->setViewHelperForm($viewHelperForm);
62
+        }
63
+        if (!isset($filter)) {
64
+            throw new \InvalidArgumentException(get_class($element) . ' cannot be used to initialize a template');
65
+        }
66
+        $viewManager = $this->service->get('ViewHelperManager');
67
+        $basePathHelper = $viewManager->get('basePath');
68
+        $serverUrlHelper = $viewManager->get('serverUrl');
69
+        $imageFileCacheHelper = $this->service->get('Organizations\ImageFileCache\Manager');
70
+        $filter->setBasePathHelper($basePathHelper);
71
+        $filter->setImageFileCacheHelper($imageFileCacheHelper);
72
+        $filter->setServerUrlHelper($serverUrlHelper);
73 73
 		
74
-		if($filter instanceof ViewModelTemplateFilterJob || method_exists($filter,'setJsonLdHelper')){
75
-			$jsonLdHelper = $viewManager->get(JsonLd::class);
76
-			$filter->setJsonLdHelper($jsonLdHelper);
77
-		}
78
-		$urlPlugin = $this->service->get('ControllerPluginManager')->get('url');
79
-		$filter->setUrlPlugin($urlPlugin);
80
-		$options = $this->service->get('Jobs/Options');
81
-		$filter->setConfig($options);
82
-		return $filter->filter($element);
83
-	}
74
+        if($filter instanceof ViewModelTemplateFilterJob || method_exists($filter,'setJsonLdHelper')){
75
+            $jsonLdHelper = $viewManager->get(JsonLd::class);
76
+            $filter->setJsonLdHelper($jsonLdHelper);
77
+        }
78
+        $urlPlugin = $this->service->get('ControllerPluginManager')->get('url');
79
+        $filter->setUrlPlugin($urlPlugin);
80
+        $options = $this->service->get('Jobs/Options');
81
+        $filter->setConfig($options);
82
+        return $filter->filter($element);
83
+    }
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	protected $service;
38 38
 	
39
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
39
+	public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
40 40
 	{
41 41
 		$this->service = $container;
42 42
 		return $this;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			$filter->setViewHelperForm($viewHelperForm);
62 62
 		}
63 63
 		if (!isset($filter)) {
64
-			throw new \InvalidArgumentException(get_class($element) . ' cannot be used to initialize a template');
64
+			throw new \InvalidArgumentException(get_class($element).' cannot be used to initialize a template');
65 65
 		}
66 66
 		$viewManager = $this->service->get('ViewHelperManager');
67 67
 		$basePathHelper = $viewManager->get('basePath');
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$filter->setImageFileCacheHelper($imageFileCacheHelper);
72 72
 		$filter->setServerUrlHelper($serverUrlHelper);
73 73
 		
74
-		if($filter instanceof ViewModelTemplateFilterJob || method_exists($filter,'setJsonLdHelper')){
74
+		if ($filter instanceof ViewModelTemplateFilterJob || method_exists($filter, 'setJsonLdHelper')) {
75 75
 			$jsonLdHelper = $viewManager->get(JsonLd::class);
76 76
 			$filter->setJsonLdHelper($jsonLdHelper);
77 77
 		}
Please login to merge, or discard this patch.