Completed
Pull Request — develop (#434)
by Carsten
06:27
created
module/Install/src/Controller/Index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 	    parent::attachDefaultListeners();
137 137
 	
138 138
 	    $events = $this->getEventManager();
139
-	    $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 );
139
+	    $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100);
140 140
     }
141 141
 
142 142
     /**
Please login to merge, or discard this patch.
module/Behat/src/CoreContext.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function getApplication()
45 45
 	{
46
-		if(!is_object(static::$application)){
46
+		if (!is_object(static::$application)) {
47 47
 			$configFile = realpath(__DIR__.'/../../../config/config.php');
48 48
 			$config = include($configFile);
49 49
 			static::$application = Application::init($config);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	public function iSubmitTheFormWithId($arg)
128 128
 	{
129 129
 		$node = $this->minkContext->getSession()->getPage()->find('css', $arg);
130
-		if($node) {
130
+		if ($node) {
131 131
 			$this->minkContext->getSession()->executeScript("jQuery('$arg').submit();");
132 132
 		} else {
133 133
 			throw new \Exception('Element not found');
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	public function iSetMainWindowName()
152 152
 	{
153 153
 		$window_name = 'main_window';
154
-		$script = 'window.name = "' . $window_name . '"';
154
+		$script = 'window.name = "'.$window_name.'"';
155 155
 		$this->getSession()->executeScript($script);
156 156
 	}
157 157
 	
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
 				break;
211 211
 			
212 212
 			default:
213
-				throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath');
213
+				throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath');
214 214
 				break;
215 215
 		}
216 216
 		
217 217
 		try {
218 218
 			$this->getSession()->executeScript($function);
219 219
 		} catch (\Exception $e) {
220
-			throw new \Exception(__METHOD__ . ' failed');
220
+			throw new \Exception(__METHOD__.' failed');
221 221
 		}
222 222
 	}
223 223
 	
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
 	 *
239 239
 	 * @return \Behat\Mink\Element\NodeElement|mixed|null
240 240
 	 */
241
-	public function getElement($locator,$selector='css')
241
+	public function getElement($locator, $selector = 'css')
242 242
 	{
243 243
 		$page = $this->minkContext->getSession()->getPage();
244
-		$element = $page->find('css',$locator);
244
+		$element = $page->find('css', $locator);
245 245
 		return $element;
246 246
 	}
247 247
 	
Please login to merge, or discard this patch.
module/Behat/src/JobContext.php 1 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.
module/Behat/src/Select2Context.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 	 * @param $field
46 46
 	 * @param $value
47 47
 	 */
48
-	public function iFillInSelect2FieldWith($field,$search,$choice=null)
48
+	public function iFillInSelect2FieldWith($field, $search, $choice = null)
49 49
 	{
50 50
 		$page = $this->getSession()->getPage();
51 51
 		$this->openField($page, $field);
52
-		$this->fillSearchField($page,$field,$search);
52
+		$this->fillSearchField($page, $field, $search);
53 53
 		$this->selectValue($page, $field, $choice);
54 54
 	}
55 55
 	
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 		if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) {
68 68
 			// Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188
69 69
 			
70
-			$element = $page->find('css','.select2-container--open .select2-search__field');
70
+			$element = $page->find('css', '.select2-container--open .select2-search__field');
71 71
 			$xpath = $element->getXpath();
72 72
 			$select2Input = $this->getSession()
73 73
 				->getDriver()
74 74
 				->getWebDriverSession()
75
-				->element('xpath',$xpath)
75
+				->element('xpath', $xpath)
76 76
 				//->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]")
77 77
 			;
78 78
 			if (!$select2Input) {
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
 	 * @param int             $time
101 101
 	 * @throws \Exception
102 102
 	 */
103
-	private function selectValue(DocumentElement $page, $field, $value, $time=5)
103
+	private function selectValue(DocumentElement $page, $field, $value, $time = 5)
104 104
 	{
105 105
 		$this->waitForLoadingResults($time);
106 106
 		
107 107
 		$chosenResults = $page->findAll('css', '.select2-results li');
108 108
 		foreach ($chosenResults as $result) {
109 109
 			$text = $result->getText();
110
-			if (false!==strpos($text,$value)) {
110
+			if (false !== strpos($text, $value)) {
111 111
 				$result->click();
112 112
 				return;
113 113
 			}
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	
119 119
 	private function openField(DocumentElement $page, $field)
120 120
 	{
121
-		$inputField = $page->find('css',$field);
122
-		if(!$inputField){
121
+		$inputField = $page->find('css', $field);
122
+		if (!$inputField) {
123 123
 			$fieldName = sprintf('select[name="%s"] + .select2-container', $field);
124 124
 			$inputField = $page->find('css', $fieldName);
125 125
 		}
Please login to merge, or discard this patch.
module/Behat/src/SummaryFormContext.php 1 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 1 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/Behat/src/UserContext.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	private $loggedInUser;
68 68
 	
69
-	public function __construct($parameters=[])
69
+	public function __construct($parameters = [])
70 70
 	{
71 71
 		$defaultLoginInfo = [
72 72
 			'facebook' => [
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
79 79
 			],
80 80
 		];
81
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
82
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
81
+		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : [];
82
+		$this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig);
83 83
 	}
84 84
 	
85 85
 	/**
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 	static public function afterSuite(AfterSuiteScope $scope)
90 90
 	{
91 91
 		$repo = static::$userRepo;
92
-		foreach(static::$users as $user){
93
-			if($repo->findByLogin($user->getLogin())){
94
-				try{
92
+		foreach (static::$users as $user) {
93
+			if ($repo->findByLogin($user->getLogin())) {
94
+				try {
95 95
 					JobContext::removeJobByUser($user);
96
-					$repo->remove($user,true);
97
-				}catch (\Exception $e){
96
+					$repo->remove($user, true);
97
+				} catch (\Exception $e) {
98 98
 				
99 99
 				}
100 100
 			}
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	{
128 128
 		$provider = strtolower($provider);
129 129
 		$mink = $this->minkContext;
130
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
131
-			$mink->fillField($field,$value);
130
+		foreach ($this->socialLoginInfo[$provider] as $field=>$value) {
131
+			$mink->fillField($field, $value);
132 132
 		}
133 133
 	}
134 134
 	
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 	 * @Given I am logged in as a recruiter
137 137
 	 * @Given I am logged in as a recruiter with :organization as organization
138 138
 	 */
139
-	public function iAmLoggedInAsARecruiter($organization=null)
139
+	public function iAmLoggedInAsARecruiter($organization = null)
140 140
 	{
141 141
 		$user = $this->thereIsAUserIdentifiedBy(
142 142
 			'[email protected]',
143
-			'test',User::ROLE_RECRUITER,
143
+			'test', User::ROLE_RECRUITER,
144 144
 			'Test Recruiter',
145 145
 			$organization
146 146
 		);
147
-		$this->startLogin($user,'test');
147
+		$this->startLogin($user, 'test');
148 148
 	}
149 149
 	
150 150
 	/**
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 	public function iDonTHaveUser($login)
155 155
 	{
156 156
 		$repo = $this->getUserRepository();
157
-		$user=$repo->findByLogin($login);
158
-		if($user instanceof UserInterface){
159
-			$repo->remove($user,true);
157
+		$user = $repo->findByLogin($login);
158
+		if ($user instanceof UserInterface) {
159
+			$repo->remove($user, true);
160 160
 		}
161 161
 	}
162 162
 	
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * @param $role
166 166
 	 * @param TableNode $fields
167 167
 	 */
168
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
168
+	public function iHaveUserWithTheFollowing($role, TableNode $fields)
169 169
 	{
170 170
 		$normalizedFields = [
171 171
 			'login' => '[email protected]',
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 			'password' => 'test',
175 175
 			'organization' => 'Cross Solution'
176 176
 		];
177
-		foreach($fields->getRowsHash() as $field=>$value){
177
+		foreach ($fields->getRowsHash() as $field=>$value) {
178 178
 			$field = Inflector::camelize($field);
179 179
 			$normalizedFields[$field] = $value;
180 180
 		}
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 	 */
195 195
 	public function iAmLoggedInAsAnAdmin()
196 196
 	{
197
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
198
-		$this->startLogin($user,'test');
197
+		$user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN);
198
+		$this->startLogin($user, 'test');
199 199
 	}
200 200
 	
201 201
 	private function startLogin(UserInterface $user, $password)
202 202
 	{
203 203
 		$currentUser = $this->currentUser;
204
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
204
+		if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) {
205 205
 			$this->iWantToLogIn();
206 206
 			$this->iSpecifyTheUsernameAs($user->getLogin());
207 207
 			$this->iSpecifyThePasswordAs($password);
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
 	/**
222 222
 	 * @Given there is a user :email identified by :password
223 223
 	 */
224
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
224
+	public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null)
225 225
 	{
226 226
 		$repo = $this->getUserRepository();
227
-		if(!is_object($user=$repo->findByEmail($email))){
228
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
227
+		if (!is_object($user = $repo->findByEmail($email))) {
228
+			$user = $this->createUser($email, $password, $role, $fullname, $organization);
229 229
 		}
230 230
 		
231
-		if(!is_null($organization)){
232
-			$this->iHaveMainOrganization($user,$organization);
231
+		if (!is_null($organization)) {
232
+			$this->iHaveMainOrganization($user, $organization);
233 233
 		}
234 234
 		$this->addCreatedUser($user);
235 235
 		return $user;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 *
245 245
 	 * @return \Auth\Entity\UserInterface
246 246
 	 */
247
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
247
+	public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter")
248 248
 	{
249 249
 		/* @var Register $service */
250 250
 		$repo = $this->getUserRepository();
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 		$user->setPassword($password);
254 254
 		$user->setRole($role);
255 255
 		
256
-		$expFullName = explode(' ',$fullname);
256
+		$expFullName = explode(' ', $fullname);
257 257
 		$info = $user->getInfo();
258 258
 		$info->setFirstName(array_shift($expFullName));
259
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
259
+		$info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : '');
260 260
 		$info->setEmail($email);
261 261
 		$info->setEmailVerified(true);
262 262
 		$repo->store($user);
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
 	 * @When I have :organization as my main organization
275 275
 	 * @param $orgName
276 276
 	 */
277
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
277
+	public function iHaveMainOrganization(UserInterface $user, $orgName)
278 278
 	{
279 279
 		/* @var $repoOrganization OrganizationRepository */
280 280
 		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
281
-		$organization=$repoOrganization->findByName($orgName);
282
-		if(!$organization instanceof Organization){
281
+		$organization = $repoOrganization->findByName($orgName);
282
+		if (!$organization instanceof Organization) {
283 283
 			$organization = new Organization();
284 284
 			$organizationName = new OrganizationName($orgName);
285 285
 			$organization->setOrganizationName($organizationName);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 	 */
304 304
 	public function iSpecifyTheUsernameAs($username)
305 305
 	{
306
-		$this->minkContext->fillField('Login name',$username);
306
+		$this->minkContext->fillField('Login name', $username);
307 307
 	}
308 308
 	
309 309
 	/**
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 */
312 312
 	public function iSpecifyThePasswordAs($password)
313 313
 	{
314
-		$this->minkContext->fillField('Password',$password);
314
+		$this->minkContext->fillField('Password', $password);
315 315
 	}
316 316
 	
317 317
 	/**
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
 		$repo = $this->getUserRepository();
323 323
 		$user = $repo->findByLogin($username);
324 324
 		
325
-		if(!$user instanceof User){
326
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
325
+		if (!$user instanceof User) {
326
+			throw new \Exception(sprintf('There is no user with this login: "%s"', $username));
327 327
 		}
328 328
 		$this->currentUser = $user;
329 329
 		$this->iWantToLogIn();
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
 	{
381 381
 		$repo = $this->getUserRepository();
382 382
 		$data = $table->getRowsHash();
383
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
384
-		$password = isset($data['password']) ? $data['password']:'test';
385
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
386
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
383
+		$email = isset($data['email']) ? $data['email'] : '[email protected]';
384
+		$password = isset($data['password']) ? $data['password'] : 'test';
385
+		$fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User';
386
+		$role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER;
387 387
 		
388
-		if(!is_object($user=$repo->findByLogin($email))){
389
-			$user = $this->createUser($email,$password,$role,$fullname);
388
+		if (!is_object($user = $repo->findByLogin($email))) {
389
+			$user = $this->createUser($email, $password, $role, $fullname);
390 390
 		}
391 391
 		$this->currentUser = $user;
392 392
 		$this->addCreatedUser($user);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 	
395 395
 	private function addCreatedUser(UserInterface $user)
396 396
 	{
397
-		if(!in_array($user,static::$users)){
397
+		if (!in_array($user, static::$users)) {
398 398
 			static::$users[] = $user;
399 399
 		}
400 400
 	}
Please login to merge, or discard this patch.
module/Jobs/config/module.config.php 1 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 1 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.