Completed
Push — develop ( a5396a...45a0ea )
by Mathias
05:23
created
module/Core/src/Core/Options/MailServiceOptions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         return $this;
100 100
     }
101 101
 
102
-    public function getUsername(){
102
+    public function getUsername() {
103 103
         return $this->connectionConfig['username'];
104 104
     }
105 105
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         return $this;
111 111
     }
112 112
 
113
-    public function getPassword(){
113
+    public function getPassword() {
114 114
         return $this->connectionConfig['password'];
115 115
     }
116 116
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         return $this;
122 122
     }
123 123
 
124
-    public function getSsl(){
124
+    public function getSsl() {
125 125
         return $this->connectionConfig['ssl'];
126 126
     }
127 127
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         return $this;
131 131
     }
132 132
 
133
-    public function getTransportClass(){
133
+    public function getTransportClass() {
134 134
         return $this->transportClass;
135 135
     }
136 136
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function getPath()
141 141
     {
142
-        if(is_null($this->path)){
142
+        if (is_null($this->path)) {
143 143
             $this->setPath(sys_get_temp_dir().'/yawik/mails');
144 144
         }
145 145
         return $this->path;
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function setPath($path)
153 153
     {
154
-        if(!is_dir($path)){
155
-            mkdir($path,0777,true);
156
-            chmod($path,0777);
154
+        if (!is_dir($path)) {
155
+            mkdir($path, 0777, true);
156
+            chmod($path, 0777);
157 157
         }
158 158
         $this->path = $path;
159 159
         return $this;
Please login to merge, or discard this patch.
module/Behat/src/JobContext.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -215,6 +215,9 @@
 block discarded – undo
215 215
 		$this->buildJob($status,$fields->getRowsHash());
216 216
 	}
217 217
 
218
+	/**
219
+	 * @param \Organizations\Entity\Organization $organization
220
+	 */
218 221
 	public function buildJob($status, $definitions,$organization = null)
219 222
     {
220 223
         $normalizedField = [
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		$element = $page->find('css',$mapMultiple[$field]);
185 185
 		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
186 186
 			$this->minkContext->selectOption($value,$multipleField);
187
-		}else{
187
+		} else{
188 188
 			$locator = $mapSelect2[$field];
189 189
 			$this->select2Context->iFillInSelect2Field($locator,$value);
190 190
 		}
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
             if($user instanceof User){
248 248
                 $job->setUser($user);
249 249
                 $job->setOrganization($organization);
250
-            }else{
250
+            } else{
251 251
                 throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
252 252
             }
253 253
         }
254 254
 
255 255
         if($status == 'draft'){
256 256
             $job->setIsDraft(true);
257
-        }elseif($status == 'published'){
257
+        } elseif($status == 'published'){
258 258
             $job->setIsDraft(false);
259 259
             $job->setDatePublishStart(new \DateTime());
260 260
         }
Please login to merge, or discard this patch.
Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -34,188 +34,188 @@  discard block
 block discarded – undo
34 34
  */
35 35
 class JobContext implements Context
36 36
 {
37
-	use CommonContextTrait;
37
+    use CommonContextTrait;
38 38
 	
39
-	/**
40
-	 * @var Select2Context
41
-	 */
42
-	private $select2Context;
39
+    /**
40
+     * @var Select2Context
41
+     */
42
+    private $select2Context;
43 43
 	
44
-	/**
45
-	 * @var Job
46
-	 */
47
-	private $currentJob;
44
+    /**
45
+     * @var Job
46
+     */
47
+    private $currentJob;
48 48
 	
49
-	/**
50
-	 * @var JobRepository
51
-	 */
52
-	static private $jobRepo;
49
+    /**
50
+     * @var JobRepository
51
+     */
52
+    static private $jobRepo;
53 53
 	
54
-	/**
55
-	 * @param User $user
56
-	 */
57
-	static public function removeJobByUser(User $user)
58
-	{
59
-		$repo = static::$jobRepo;
60
-		$results = $repo->findBy(['user' => $user]);
61
-		foreach($results as $result){
62
-			$repo->remove($result,true);
63
-		}
64
-	}
54
+    /**
55
+     * @param User $user
56
+     */
57
+    static public function removeJobByUser(User $user)
58
+    {
59
+        $repo = static::$jobRepo;
60
+        $results = $repo->findBy(['user' => $user]);
61
+        foreach($results as $result){
62
+            $repo->remove($result,true);
63
+        }
64
+    }
65 65
 	
66
-	/**
67
-	 * @BeforeScenario
68
-	 *
69
-	 * @param BeforeScenarioScope $scope
70
-	 */
71
-	public function beforeScenario(BeforeScenarioScope $scope)
72
-	{
73
-		$this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class);
74
-		if(is_null(static::$jobRepo)){
75
-			$this->gatherContexts($scope);
76
-			static::$jobRepo = $this->getJobRepository();
77
-		}
78
-	}
66
+    /**
67
+     * @BeforeScenario
68
+     *
69
+     * @param BeforeScenarioScope $scope
70
+     */
71
+    public function beforeScenario(BeforeScenarioScope $scope)
72
+    {
73
+        $this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class);
74
+        if(is_null(static::$jobRepo)){
75
+            $this->gatherContexts($scope);
76
+            static::$jobRepo = $this->getJobRepository();
77
+        }
78
+    }
79 79
 	
80
-	/**
81
-	 * @Given I go to job board page
82
-	 */
83
-	public function iGoToJobBoardPage()
84
-	{
85
-		$this->visit('/jobboard');
86
-	}
80
+    /**
81
+     * @Given I go to job board page
82
+     */
83
+    public function iGoToJobBoardPage()
84
+    {
85
+        $this->visit('/jobboard');
86
+    }
87 87
 	
88
-	/**
89
-	 * @Given I go to create job page
90
-	 */
91
-	public function iGoToCreateJob()
92
-	{
93
-	    $url = $this->buildUrl('lang/jobs/manage',['action' => 'edit']);
94
-		$this->visit($url);
95
-	}
88
+    /**
89
+     * @Given I go to create job page
90
+     */
91
+    public function iGoToCreateJob()
92
+    {
93
+        $url = $this->buildUrl('lang/jobs/manage',['action' => 'edit']);
94
+        $this->visit($url);
95
+    }
96 96
 	
97
-	/**
98
-	 * @Given I go to job overview page
99
-	 */
100
-	public function iGoToJobOverviewPage()
101
-	{
102
-		$this->visit('/jobs');
103
-	}
97
+    /**
98
+     * @Given I go to job overview page
99
+     */
100
+    public function iGoToJobOverviewPage()
101
+    {
102
+        $this->visit('/jobs');
103
+    }
104 104
 	
105
-	/**
106
-	 * @Given I go to edit job draft with title :jobTitle
107
-	 * @param $jobTitle
108
-	 * @throws \Exception when job is not found
109
-	 */
110
-	public function iGoToEditJobWithTitle($jobTitle)
111
-	{
112
-		$job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
113
-		if(!$job instanceof Job){
114
-			throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
115
-		}
116
-		$this->currentJob = $job;
117
-		$url = $this->buildUrl('lang/jobs/manage',[
118
-		    'id' => $job->getId()
105
+    /**
106
+     * @Given I go to edit job draft with title :jobTitle
107
+     * @param $jobTitle
108
+     * @throws \Exception when job is not found
109
+     */
110
+    public function iGoToEditJobWithTitle($jobTitle)
111
+    {
112
+        $job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
113
+        if(!$job instanceof Job){
114
+            throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
115
+        }
116
+        $this->currentJob = $job;
117
+        $url = $this->buildUrl('lang/jobs/manage',[
118
+            'id' => $job->getId()
119 119
         ]);
120
-		$this->visit($url);
121
-	}
120
+        $this->visit($url);
121
+    }
122 122
 	
123
-	/**
124
-	 * @Given I don't have any classification data
125
-	 */
126
-	public function iDonTHaveAnyClassificationData()
127
-	{
128
-		$this->currentJob->setClassifications(new Classifications());
129
-		$this->getJobRepository()->store($this->currentJob);
130
-	}
123
+    /**
124
+     * @Given I don't have any classification data
125
+     */
126
+    public function iDonTHaveAnyClassificationData()
127
+    {
128
+        $this->currentJob->setClassifications(new Classifications());
129
+        $this->getJobRepository()->store($this->currentJob);
130
+    }
131 131
 	
132
-	/**
133
-	 * @When I don't have any posted job
134
-	 */
135
-	public function iDonTHaveAnyPostedJob()
136
-	{
137
-		/* @var $jobRepository JobRepository */
138
-		/* @var $job Job */
139
-		$user = $this->getUserContext()->getCurrentUser();
132
+    /**
133
+     * @When I don't have any posted job
134
+     */
135
+    public function iDonTHaveAnyPostedJob()
136
+    {
137
+        /* @var $jobRepository JobRepository */
138
+        /* @var $job Job */
139
+        $user = $this->getUserContext()->getCurrentUser();
140 140
 
141
-		$jobRepository = $this->getJobRepository();
142
-		$results = $jobRepository->getUserJobs($user->getId());
143
-		foreach($results as $job){
144
-			$jobRepository->remove($job,true);
145
-		}
146
-		$this->currentJob = null;
147
-	}
141
+        $jobRepository = $this->getJobRepository();
142
+        $results = $jobRepository->getUserJobs($user->getId());
143
+        foreach($results as $job){
144
+            $jobRepository->remove($job,true);
145
+        }
146
+        $this->currentJob = null;
147
+    }
148 148
 	
149
-	/**
150
-	 * @When I fill job location search with :search and choose :choice
151
-	 *
152
-	 */
153
-	public function iFillJobLocationAndChoose($search,$choice)
154
-	{
155
-		$select2 = $this->select2Context;
156
-		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
157
-	}
149
+    /**
150
+     * @When I fill job location search with :search and choose :choice
151
+     *
152
+     */
153
+    public function iFillJobLocationAndChoose($search,$choice)
154
+    {
155
+        $select2 = $this->select2Context;
156
+        $select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
157
+    }
158 158
 	
159
-	/**
160
-	 * @When I choose :value from :field
161
-	 */
162
-	public function iJobClassificationSelect($value,$field)
163
-	{
164
-		$field = Inflector::camelize($field);
159
+    /**
160
+     * @When I choose :value from :field
161
+     */
162
+    public function iJobClassificationSelect($value,$field)
163
+    {
164
+        $field = Inflector::camelize($field);
165 165
 		
166
-		$mapSelect2 = [
167
-			'professions' => '#classifications-professions-span .select2-container',
168
-			'industries'  => '#classifications-industries-span .select2-container',
169
-			'employmentTypes' => '#classifications-employmentTypes-span .select2-container',
170
-		];
166
+        $mapSelect2 = [
167
+            'professions' => '#classifications-professions-span .select2-container',
168
+            'industries'  => '#classifications-industries-span .select2-container',
169
+            'employmentTypes' => '#classifications-employmentTypes-span .select2-container',
170
+        ];
171 171
 		
172
-		$mapMultiple = [
173
-			'professions'       => "select#classifications-professions",
174
-			'industries'        => "select#classifications-industries",
175
-			'employmentTypes'    => "select#classifications-employmentTypes",
176
-		];
172
+        $mapMultiple = [
173
+            'professions'       => "select#classifications-professions",
174
+            'industries'        => "select#classifications-industries",
175
+            'employmentTypes'    => "select#classifications-employmentTypes",
176
+        ];
177 177
 		
178
-		if(!isset($mapSelect2[$field])){
179
-			throw new \Exception('Undefined field selection value "'.$field.'"');
180
-		}
178
+        if(!isset($mapSelect2[$field])){
179
+            throw new \Exception('Undefined field selection value "'.$field.'"');
180
+        }
181 181
 		
182
-		$multipleField = $mapMultiple[$field];
183
-		$page = $this->minkContext->getSession()->getPage();
184
-		$element = $page->find('css',$mapMultiple[$field]);
185
-		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
186
-			$this->minkContext->selectOption($value,$multipleField);
187
-		}else{
188
-			$locator = $mapSelect2[$field];
189
-			$this->select2Context->iFillInSelect2Field($locator,$value);
190
-		}
191
-	}
182
+        $multipleField = $mapMultiple[$field];
183
+        $page = $this->minkContext->getSession()->getPage();
184
+        $element = $page->find('css',$mapMultiple[$field]);
185
+        if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
186
+            $this->minkContext->selectOption($value,$multipleField);
187
+        }else{
188
+            $locator = $mapSelect2[$field];
189
+            $this->select2Context->iFillInSelect2Field($locator,$value);
190
+        }
191
+    }
192 192
 	
193
-	/**
194
-	 * @return JobRepository
195
-	 */
196
-	public function getJobRepository()
197
-	{
198
-		return $this->getRepository('Jobs/Job');
199
-	}
193
+    /**
194
+     * @return JobRepository
195
+     */
196
+    public function getJobRepository()
197
+    {
198
+        return $this->getRepository('Jobs/Job');
199
+    }
200 200
 	
201
-	/**
202
-	 * @return CategoriesRepo
203
-	 */
204
-	public function getCategoriesRepository()
205
-	{
206
-		return $this->getRepository('Jobs/Category');
207
-	}
201
+    /**
202
+     * @return CategoriesRepo
203
+     */
204
+    public function getCategoriesRepository()
205
+    {
206
+        return $this->getRepository('Jobs/Category');
207
+    }
208 208
 	
209
-	/**
210
-	 * @When I have a :status job with the following:
211
-	 * @param TableNode $fields
212
-	 */
213
-	public function iHaveAJobWithTheFollowing($status,TableNode $fields)
214
-	{
215
-		$this->buildJob($status,$fields->getRowsHash());
216
-	}
209
+    /**
210
+     * @When I have a :status job with the following:
211
+     * @param TableNode $fields
212
+     */
213
+    public function iHaveAJobWithTheFollowing($status,TableNode $fields)
214
+    {
215
+        $this->buildJob($status,$fields->getRowsHash());
216
+    }
217 217
 
218
-	public function buildJob($status, $definitions,$organization = null)
218
+    public function buildJob($status, $definitions,$organization = null)
219 219
     {
220 220
         $normalizedField = [
221 221
             'template' => 'modern',
@@ -284,84 +284,84 @@  discard block
 block discarded – undo
284 284
     }
285 285
 
286 286
 	
287
-	private function setLocation(Job $job, $term)
288
-	{
289
-		/* @var $client Photon */
290
-		$client = $this->coreContext->getServiceManager()->get('Geo/Client');
291
-		$result = $client->queryOne($term);
292
-		$location = new Location();
293
-		$serialized = Json::encode($result);
294
-		$location->fromString($serialized);
287
+    private function setLocation(Job $job, $term)
288
+    {
289
+        /* @var $client Photon */
290
+        $client = $this->coreContext->getServiceManager()->get('Geo/Client');
291
+        $result = $client->queryOne($term);
292
+        $location = new Location();
293
+        $serialized = Json::encode($result);
294
+        $location->fromString($serialized);
295 295
 		
296
-		$locations = $job->getLocations();
297
-		if(count($locations)){
298
-			$locations->clear();
299
-		}
300
-		$job->getLocations()->add($location);
301
-	}
296
+        $locations = $job->getLocations();
297
+        if(count($locations)){
298
+            $locations->clear();
299
+        }
300
+        $job->getLocations()->add($location);
301
+    }
302 302
 	
303
-	private function addProfessions(Job &$job,$terms)
304
-	{
305
-		$professions = $this->getCategories($terms);
306
-		foreach($professions as $profession){
307
-			$values = $job->getClassifications()->getProfessions()->getValues();
308
-			if(!is_array($values) || !in_array($profession,$values)){
309
-				$job->getClassifications()->getProfessions()->getItems()->add($profession);
310
-			}
311
-		}
312
-	}
303
+    private function addProfessions(Job &$job,$terms)
304
+    {
305
+        $professions = $this->getCategories($terms);
306
+        foreach($professions as $profession){
307
+            $values = $job->getClassifications()->getProfessions()->getValues();
308
+            if(!is_array($values) || !in_array($profession,$values)){
309
+                $job->getClassifications()->getProfessions()->getItems()->add($profession);
310
+            }
311
+        }
312
+    }
313 313
 	
314
-	private function addIndustries(Job &$job, $terms)
315
-	{
316
-		$industries = $this->getCategories($terms);
317
-		foreach($industries as $industry){
318
-			$values = $job->getClassifications()->getIndustries()->getValues();
319
-			if(!is_array($values) || !in_array($industry,$values)){
320
-				$job->getClassifications()->getIndustries()->getItems()->add($industry);
321
-			}
322
-		}
323
-	}
314
+    private function addIndustries(Job &$job, $terms)
315
+    {
316
+        $industries = $this->getCategories($terms);
317
+        foreach($industries as $industry){
318
+            $values = $job->getClassifications()->getIndustries()->getValues();
319
+            if(!is_array($values) || !in_array($industry,$values)){
320
+                $job->getClassifications()->getIndustries()->getItems()->add($industry);
321
+            }
322
+        }
323
+    }
324 324
 	
325
-	/**
326
-	 * @param array $categories
327
-	 *
328
-	 * @return mixed
329
-	 */
330
-	private function getCategories(array $categories)
331
-	{
332
-		$catRepo = $this->getCategoriesRepository();
325
+    /**
326
+     * @param array $categories
327
+     *
328
+     * @return mixed
329
+     */
330
+    private function getCategories(array $categories)
331
+    {
332
+        $catRepo = $this->getCategoriesRepository();
333 333
 		
334
-		// get a professions
335
-		$qb = $catRepo->createQueryBuilder()
336
-		              ->field('name')->in($categories)
337
-		              ->getQuery()
338
-		;
339
-		$results = $qb->execute();
340
-		return $results->toArray();
341
-	}
334
+        // get a professions
335
+        $qb = $catRepo->createQueryBuilder()
336
+                        ->field('name')->in($categories)
337
+                        ->getQuery()
338
+        ;
339
+        $results = $qb->execute();
340
+        return $results->toArray();
341
+    }
342 342
 	
343 343
 	
344
-	/**
345
-	 * @return Job
346
-	 */
347
-	private function getCurrentUserJobDraft($jobTitle)
348
-	{
349
-		$repo = $this->getJobRepository();
350
-		$user = $this->getCurrentUser();
344
+    /**
345
+     * @return Job
346
+     */
347
+    private function getCurrentUserJobDraft($jobTitle)
348
+    {
349
+        $repo = $this->getJobRepository();
350
+        $user = $this->getCurrentUser();
351 351
 		
352
-		$job = $repo->findDraft($user);
352
+        $job = $repo->findDraft($user);
353 353
 		
354
-		if(is_null($job)){
355
-			$job = new Job();
356
-			$job
357
-				->setUser($user)
358
-				->setOrganization($user->getOrganization()->getOrganization())
359
-				->setStatus(StatusInterface::CREATED)
360
-			;
361
-			$job->setIsDraft(true);
362
-		}
363
-		$job->setTitle($jobTitle);
364
-		$repo->store($job);
365
-		return $job;
366
-	}
354
+        if(is_null($job)){
355
+            $job = new Job();
356
+            $job
357
+                ->setUser($user)
358
+                ->setOrganization($user->getOrganization()->getOrganization())
359
+                ->setStatus(StatusInterface::CREATED)
360
+            ;
361
+            $job->setIsDraft(true);
362
+        }
363
+        $job->setTitle($jobTitle);
364
+        $repo->store($job);
365
+        return $job;
366
+    }
367 367
 }
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 	{
59 59
 		$repo = static::$jobRepo;
60 60
 		$results = $repo->findBy(['user' => $user]);
61
-		foreach($results as $result){
62
-			$repo->remove($result,true);
61
+		foreach ($results as $result) {
62
+			$repo->remove($result, true);
63 63
 		}
64 64
 	}
65 65
 	
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	public function beforeScenario(BeforeScenarioScope $scope)
72 72
 	{
73 73
 		$this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class);
74
-		if(is_null(static::$jobRepo)){
74
+		if (is_null(static::$jobRepo)) {
75 75
 			$this->gatherContexts($scope);
76 76
 			static::$jobRepo = $this->getJobRepository();
77 77
 		}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function iGoToCreateJob()
92 92
 	{
93
-	    $url = $this->buildUrl('lang/jobs/manage',['action' => 'edit']);
93
+	    $url = $this->buildUrl('lang/jobs/manage', ['action' => 'edit']);
94 94
 		$this->visit($url);
95 95
 	}
96 96
 	
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
 	public function iGoToEditJobWithTitle($jobTitle)
111 111
 	{
112 112
 		$job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]);
113
-		if(!$job instanceof Job){
114
-			throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle));
113
+		if (!$job instanceof Job) {
114
+			throw new \Exception(sprintf('Job with title "%s" is not found', $jobTitle));
115 115
 		}
116 116
 		$this->currentJob = $job;
117
-		$url = $this->buildUrl('lang/jobs/manage',[
117
+		$url = $this->buildUrl('lang/jobs/manage', [
118 118
 		    'id' => $job->getId()
119 119
         ]);
120 120
 		$this->visit($url);
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$jobRepository = $this->getJobRepository();
142 142
 		$results = $jobRepository->getUserJobs($user->getId());
143
-		foreach($results as $job){
144
-			$jobRepository->remove($job,true);
143
+		foreach ($results as $job) {
144
+			$jobRepository->remove($job, true);
145 145
 		}
146 146
 		$this->currentJob = null;
147 147
 	}
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 	 * @When I fill job location search with :search and choose :choice
151 151
 	 *
152 152
 	 */
153
-	public function iFillJobLocationAndChoose($search,$choice)
153
+	public function iFillJobLocationAndChoose($search, $choice)
154 154
 	{
155 155
 		$select2 = $this->select2Context;
156
-		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice);
156
+		$select2->iFillInSelect2FieldWith('jobBase[geoLocation]', $search, $choice);
157 157
 	}
158 158
 	
159 159
 	/**
160 160
 	 * @When I choose :value from :field
161 161
 	 */
162
-	public function iJobClassificationSelect($value,$field)
162
+	public function iJobClassificationSelect($value, $field)
163 163
 	{
164 164
 		$field = Inflector::camelize($field);
165 165
 		
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 			'employmentTypes'    => "select#classifications-employmentTypes",
176 176
 		];
177 177
 		
178
-		if(!isset($mapSelect2[$field])){
178
+		if (!isset($mapSelect2[$field])) {
179 179
 			throw new \Exception('Undefined field selection value "'.$field.'"');
180 180
 		}
181 181
 		
182 182
 		$multipleField = $mapMultiple[$field];
183 183
 		$page = $this->minkContext->getSession()->getPage();
184
-		$element = $page->find('css',$mapMultiple[$field]);
185
-		if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){
186
-			$this->minkContext->selectOption($value,$multipleField);
187
-		}else{
184
+		$element = $page->find('css', $mapMultiple[$field]);
185
+		if (!is_null($element) && $element->getAttribute('multiple') == 'multiple') {
186
+			$this->minkContext->selectOption($value, $multipleField);
187
+		} else {
188 188
 			$locator = $mapSelect2[$field];
189
-			$this->select2Context->iFillInSelect2Field($locator,$value);
189
+			$this->select2Context->iFillInSelect2Field($locator, $value);
190 190
 		}
191 191
 	}
192 192
 	
@@ -210,20 +210,20 @@  discard block
 block discarded – undo
210 210
 	 * @When I have a :status job with the following:
211 211
 	 * @param TableNode $fields
212 212
 	 */
213
-	public function iHaveAJobWithTheFollowing($status,TableNode $fields)
213
+	public function iHaveAJobWithTheFollowing($status, TableNode $fields)
214 214
 	{
215
-		$this->buildJob($status,$fields->getRowsHash());
215
+		$this->buildJob($status, $fields->getRowsHash());
216 216
 	}
217 217
 
218
-	public function buildJob($status, $definitions,$organization = null)
218
+	public function buildJob($status, $definitions, $organization = null)
219 219
     {
220 220
         $normalizedField = [
221 221
             'template' => 'modern',
222 222
         ];
223
-        foreach($definitions as $field => $value){
223
+        foreach ($definitions as $field => $value) {
224 224
             $field = Inflector::camelize($field);
225
-            if($field == 'professions' || $field == 'industries'){
226
-                $value = explode(',',$value);
225
+            if ($field == 'professions' || $field == 'industries') {
226
+                $value = explode(',', $value);
227 227
             }
228 228
             $normalizedField[$field] = $value;
229 229
         }
@@ -232,49 +232,49 @@  discard block
 block discarded – undo
232 232
         $job = $jobRepo->findOneBy([
233 233
             'title' => $normalizedField['title']
234 234
         ]);
235
-        if(!$job instanceof Job){
235
+        if (!$job instanceof Job) {
236 236
             $job = new Job();
237 237
             $job->setTitle($normalizedField['title']);
238 238
         }
239 239
 
240
-        if(isset($normalizedField['user'])){
240
+        if (isset($normalizedField['user'])) {
241 241
             /* @var $userRepo UserRepository */
242 242
             $userRepo = $this->getRepository('Auth\Entity\User');
243 243
             $user = $userRepo->findOneBy(['login' => $normalizedField['user']]);
244
-            if(is_null($organization)){
244
+            if (is_null($organization)) {
245 245
                 $organization = $user->getOrganization()->getOrganization();
246 246
             }
247
-            if($user instanceof User){
247
+            if ($user instanceof User) {
248 248
                 $job->setUser($user);
249 249
                 $job->setOrganization($organization);
250
-            }else{
250
+            } else {
251 251
                 throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']);
252 252
             }
253 253
         }
254 254
 
255
-        if($status == 'draft'){
255
+        if ($status == 'draft') {
256 256
             $job->setIsDraft(true);
257
-        }elseif($status == 'published'){
257
+        }elseif ($status == 'published') {
258 258
             $job->setIsDraft(false);
259 259
             $job->setDatePublishStart(new \DateTime());
260 260
         }
261 261
         $job->setStatus(Status::ACTIVE);
262 262
 
263
-        if(isset($normalizedField['location'])){
264
-            $this->setLocation($job,$normalizedField['location']);
263
+        if (isset($normalizedField['location'])) {
264
+            $this->setLocation($job, $normalizedField['location']);
265 265
         }
266
-        if(isset($normalizedField['professions'])){
267
-            $this->addProfessions($job,$normalizedField['professions']);
266
+        if (isset($normalizedField['professions'])) {
267
+            $this->addProfessions($job, $normalizedField['professions']);
268 268
         }
269 269
 
270
-        if(isset($normalizedField['industries'])){
271
-            $this->addIndustries($job,$normalizedField['industries']);
270
+        if (isset($normalizedField['industries'])) {
271
+            $this->addIndustries($job, $normalizedField['industries']);
272 272
         }
273
-        if(isset($normalizedField['employmentTypes'])){
273
+        if (isset($normalizedField['employmentTypes'])) {
274 274
             $types = $this->getCategories([$normalizedField['employmentTypes']]);
275 275
             $type = array_shift($types);
276 276
             $values = $job->getClassifications()->getEmploymentTypes()->getValues();
277
-            if(!is_array($values) || !in_array($type,$values)){
277
+            if (!is_array($values) || !in_array($type, $values)) {
278 278
                 $job->getClassifications()->getEmploymentTypes()->getItems()->add($type);
279 279
             }
280 280
         }
@@ -294,18 +294,18 @@  discard block
 block discarded – undo
294 294
 		$location->fromString($serialized);
295 295
 		
296 296
 		$locations = $job->getLocations();
297
-		if(count($locations)){
297
+		if (count($locations)) {
298 298
 			$locations->clear();
299 299
 		}
300 300
 		$job->getLocations()->add($location);
301 301
 	}
302 302
 	
303
-	private function addProfessions(Job &$job,$terms)
303
+	private function addProfessions(Job &$job, $terms)
304 304
 	{
305 305
 		$professions = $this->getCategories($terms);
306
-		foreach($professions as $profession){
306
+		foreach ($professions as $profession) {
307 307
 			$values = $job->getClassifications()->getProfessions()->getValues();
308
-			if(!is_array($values) || !in_array($profession,$values)){
308
+			if (!is_array($values) || !in_array($profession, $values)) {
309 309
 				$job->getClassifications()->getProfessions()->getItems()->add($profession);
310 310
 			}
311 311
 		}
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	private function addIndustries(Job &$job, $terms)
315 315
 	{
316 316
 		$industries = $this->getCategories($terms);
317
-		foreach($industries as $industry){
317
+		foreach ($industries as $industry) {
318 318
 			$values = $job->getClassifications()->getIndustries()->getValues();
319
-			if(!is_array($values) || !in_array($industry,$values)){
319
+			if (!is_array($values) || !in_array($industry, $values)) {
320 320
 				$job->getClassifications()->getIndustries()->getItems()->add($industry);
321 321
 			}
322 322
 		}
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 		
352 352
 		$job = $repo->findDraft($user);
353 353
 		
354
-		if(is_null($job)){
354
+		if (is_null($job)) {
355 355
 			$job = new Job();
356 356
 			$job
357 357
 				->setUser($user)
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Entity/Organization.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
     /**
48 48
      * Always enabled even if there are no active jobs
49 49
      */
50
-    const PROFILE_ALWAYS_ENABLE     = 'always';
50
+    const PROFILE_ALWAYS_ENABLE = 'always';
51 51
 
52 52
     /**
53 53
      * Hide if there are no jobs available
54 54
      */
55
-    const PROFILE_ACTIVE_JOBS       = 'active-jobs';
55
+    const PROFILE_ACTIVE_JOBS = 'active-jobs';
56 56
 
57 57
     /**
58 58
      * Always disabled profile
59 59
      */
60
-    const PROFILE_DISABLED          = 'disabled';
60
+    const PROFILE_DISABLED = 'disabled';
61 61
 
62 62
     /**
63 63
      * Event name of post construct event.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     public function getParent($returnSelf = false)
287 287
     {
288
-        return $this->parent ? : ($returnSelf ? $this : null);
288
+        return $this->parent ?: ($returnSelf ? $this : null);
289 289
     }
290 290
 
291 291
     /**
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
      */
517 517
     public function getPermissionsResourceId()
518 518
     {
519
-        return 'organization:' . $this->getId();
519
+        return 'organization:'.$this->getId();
520 520
     }
521 521
 
522 522
     /**
Please login to merge, or discard this patch.
Organizations/src/Organizations/Form/OrganizationsProfileFieldset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function getHydrator()
25 25
     {
26 26
         if (!$this->hydrator) {
27
-            $hydrator           = new EntityHydrator();
27
+            $hydrator = new EntityHydrator();
28 28
             $this->setHydrator($hydrator);
29 29
         }
30 30
         return $this->hydrator;
Please login to merge, or discard this patch.
Organizations/src/Organizations/Controller/InviteEmployeeController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     private $orgRepo;
37 37
 
38
-	public function __construct(
38
+    public function __construct(
39 39
         OrganizationRepository $orgRepo
40 40
     )
41 41
     {
Please login to merge, or discard this patch.
module/Behat/src/CommonContextTrait.php 3 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,6 +51,9 @@  discard block
 block discarded – undo
51 51
 		$this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class);
52 52
 	}
53 53
 	
54
+	/**
55
+	 * @param string $name
56
+	 */
54 57
 	public function buildUrl($name, array $params=array(), array $options=array())
55 58
 	{
56 59
 	    $defaults = ['lang'=>'en'];
@@ -71,7 +74,7 @@  discard block
 block discarded – undo
71 74
 	}
72 75
 	
73 76
 	/**
74
-	 * @param $id
77
+	 * @param string $id
75 78
 	 * @return mixed|object
76 79
 	 */
77 80
 	public function getService($id)
@@ -80,7 +83,7 @@  discard block
 block discarded – undo
80 83
 	}
81 84
 	
82 85
 	/**
83
-	 * @param $id
86
+	 * @param string $id
84 87
 	 *
85 88
 	 * @return RepositoryInterface
86 89
 	 */
Please login to merge, or discard this patch.
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -18,43 +18,43 @@  discard block
 block discarded – undo
18 18
 
19 19
 trait CommonContextTrait
20 20
 {
21
-	/**
22
-	 * @var MinkContext
23
-	 */
24
-	protected $minkContext;
21
+    /**
22
+     * @var MinkContext
23
+     */
24
+    protected $minkContext;
25 25
 	
26
-	/**
27
-	 * @var CoreContext
28
-	 */
29
-	protected $coreContext;
26
+    /**
27
+     * @var CoreContext
28
+     */
29
+    protected $coreContext;
30 30
 	
31
-	/**
32
-	 * @var UserContext
33
-	 */
34
-	protected $userContext;
31
+    /**
32
+     * @var UserContext
33
+     */
34
+    protected $userContext;
35 35
 	
36
-	/**
37
-	 * @var SummaryFormContext
38
-	 */
39
-	protected $summaryFormContext;
36
+    /**
37
+     * @var SummaryFormContext
38
+     */
39
+    protected $summaryFormContext;
40 40
 	
41
-	/**
42
-	 * @BeforeScenario
43
-	 *
44
-	 * @param BeforeScenarioScope $scope
45
-	 */
46
-	final public function gatherContexts(BeforeScenarioScope $scope)
47
-	{
48
-		$this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
49
-		$this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
50
-		$this->userContext = $scope->getEnvironment()->getContext(UserContext::class);
51
-		$this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class);
52
-	}
41
+    /**
42
+     * @BeforeScenario
43
+     *
44
+     * @param BeforeScenarioScope $scope
45
+     */
46
+    final public function gatherContexts(BeforeScenarioScope $scope)
47
+    {
48
+        $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
49
+        $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
50
+        $this->userContext = $scope->getEnvironment()->getContext(UserContext::class);
51
+        $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class);
52
+    }
53 53
 	
54
-	public function buildUrl($name, array $params=array(), array $options=array())
55
-	{
56
-	    $defaults = ['lang'=>'en'];
57
-	    $params = array_merge($defaults,$params);
54
+    public function buildUrl($name, array $params=array(), array $options=array())
55
+    {
56
+        $defaults = ['lang'=>'en'];
57
+        $params = array_merge($defaults,$params);
58 58
         /* @var Url $urlHelper */
59 59
         $urlHelper = $this
60 60
             ->getService('ViewHelperManager')
@@ -63,36 +63,36 @@  discard block
 block discarded – undo
63 63
         $url = $urlHelper($name,$params,$options);
64 64
 
65 65
         return $this->coreContext->generateUrl($url);
66
-	}
66
+    }
67 67
 	
68
-	public function visit($url)
69
-	{
70
-		$this->coreContext->iVisit($url);
71
-	}
68
+    public function visit($url)
69
+    {
70
+        $this->coreContext->iVisit($url);
71
+    }
72 72
 	
73
-	/**
74
-	 * @param $id
75
-	 * @return mixed|object
76
-	 */
77
-	public function getService($id)
78
-	{
79
-		return $this->coreContext->getServiceManager()->get($id);
80
-	}
73
+    /**
74
+     * @param $id
75
+     * @return mixed|object
76
+     */
77
+    public function getService($id)
78
+    {
79
+        return $this->coreContext->getServiceManager()->get($id);
80
+    }
81 81
 	
82
-	/**
83
-	 * @param $id
84
-	 *
85
-	 * @return RepositoryInterface
86
-	 */
87
-	public function getRepository($id)
88
-	{
89
-		return $this->coreContext->getRepositories()->get($id);
90
-	}
82
+    /**
83
+     * @param $id
84
+     *
85
+     * @return RepositoryInterface
86
+     */
87
+    public function getRepository($id)
88
+    {
89
+        return $this->coreContext->getRepositories()->get($id);
90
+    }
91 91
 
92 92
     /**
93 93
      * @return UserContext
94 94
      */
95
-	public function getUserContext()
95
+    public function getUserContext()
96 96
     {
97 97
         return $this->userContext;
98 98
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,16 +51,16 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
module/Behat/src/SettingsContext.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -14,26 +14,26 @@
 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('/settings');
19
+    /**
20
+     * @Given I go to settings page
21
+     */
22
+    public function iGoToSettingsPage()
23
+    {
24
+        //$this->visit('/settings');
25 25
         $url = $this->buildUrl('lang/settings');
26 26
         $this->visit($url);
27
-	}
27
+    }
28 28
 	
29
-	/**
30
-	 * @Given I go to email template settings page
31
-	 */
32
-	public function iGoToEmailTemplatePage()
33
-	{
34
-	    $url = $this->buildUrl('lang/settings',[
35
-	        'module' => 'Applications'
29
+    /**
30
+     * @Given I go to email template settings page
31
+     */
32
+    public function iGoToEmailTemplatePage()
33
+    {
34
+        $url = $this->buildUrl('lang/settings',[
35
+            'module' => 'Applications'
36 36
         ]);
37
-		$this->visit($url);
38
-	}
37
+        $this->visit($url);
38
+    }
39 39
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
module/Behat/src/ApplicationContext.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -22,37 +22,37 @@
 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 = $this->buildUrl('lang/apply',[
45
-		    'applyId' => $job->getApplyId()
44
+        $url = $this->buildUrl('lang/apply',[
45
+            'applyId' => $job->getApplyId()
46 46
         ]);
47
-		$this->visit($url);
48
-	}
47
+        $this->visit($url);
48
+    }
49 49
 	
50
-	/**
51
-	 * @Given I visit job categories
52
-	 */
53
-	public function visitJobsCategories()
54
-	{
55
-		$url = '/admin/jobs/categories';
56
-		$this->visit($url);
57
-	}
50
+    /**
51
+     * @Given I visit job categories
52
+     */
53
+    public function visitJobsCategories()
54
+    {
55
+        $url = '/admin/jobs/categories';
56
+        $this->visit($url);
57
+    }
58 58
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 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());
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);
Please login to merge, or discard this patch.
module/Behat/src/CvContext.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@
 block discarded – undo
22 22
  */
23 23
 class CvContext implements Context
24 24
 {
25
-	use CommonContextTrait;
25
+    use CommonContextTrait;
26 26
 	
27 27
 	
28
-	/**
29
-	 * @Given I go to manage my resume page
30
-	 */
31
-	public function iGoToManageResumePage()
32
-	{
33
-	    $url = $this->buildUrl('lang/my-cv');
34
-		$this->visit($url);
35
-	}
28
+    /**
29
+     * @Given I go to manage my resume page
30
+     */
31
+    public function iGoToManageResumePage()
32
+    {
33
+        $url = $this->buildUrl('lang/my-cv');
34
+        $this->visit($url);
35
+    }
36 36
 	
37
-	/**
38
-	 * @When I click edit on my personal information
39
-	 */
40
-	public function iClickEditOnPersonalInformations()
41
-	{
42
-		$this->summaryFormContext->iClickEditOnForm('resumePersonalInformations');
43
-	}
37
+    /**
38
+     * @When I click edit on my personal information
39
+     */
40
+    public function iClickEditOnPersonalInformations()
41
+    {
42
+        $this->summaryFormContext->iClickEditOnForm('resumePersonalInformations');
43
+    }
44 44
 }
Please login to merge, or discard this patch.