Completed
Push — develop ( 2e5ccf...97dfc2 )
by
unknown
24:02 queued 16:27
created
module/Jobs/src/Jobs/Entity/Decorator/JsonLdProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $dateStart = $this->job->getDatePublishStart();
53 53
         $dateStart = $dateStart ? $dateStart->format('Y-m-d') : null;
54 54
 
55
-        $array=[
55
+        $array = [
56 56
             '@context'=>'http://schema.org/',
57 57
             '@type' => 'JobPosting',
58 58
             'title' => $this->job->getTitle(),
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      *
85 85
      * @return array
86 86
      */
87
-    private function getLocations($locations){
88
-        $array=[];
89
-        foreach($locations as $location){ /* @var \Core\Entity\LocationInterface $location */
87
+    private function getLocations($locations) {
88
+        $array = [];
89
+        foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */
90 90
             array_push(
91 91
                 $array,
92 92
                 [
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     private function getDescription(TemplateValuesInterface $values) {
114 114
 
115
-        $description=sprintf(
115
+        $description = sprintf(
116 116
             "<p>%s</p>".
117 117
             "<h1>%s</h1>".
118 118
             "<h3>Requirements</h3><p>%s</p>".
Please login to merge, or discard this patch.
config/config.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 $env = getenv('APPLICATION_ENV') ?: 'production';
14 14
 
15 15
 $coreModules = include 'common.modules.php';
16
-if (!file_exists(__DIR__ . '/autoload/yawik.config.global.php')) {
17
-    $modules = array_merge($coreModules,[
16
+if (!file_exists(__DIR__.'/autoload/yawik.config.global.php')) {
17
+    $modules = array_merge($coreModules, [
18 18
         'Install',
19 19
     ]);
20 20
 } else {
21
-    $modules = array_merge($coreModules,[
21
+    $modules = array_merge($coreModules, [
22 22
         'Core',
23 23
         'Auth',
24 24
         'Cv',
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
         // kann und über Server-Variablen oder ähnlichen steuern kann
36 36
         $allModules = False;
37 37
     }
38
-    foreach (glob(__DIR__ . '/autoload/*.module.php') as $moduleFile) {
38
+    foreach (glob(__DIR__.'/autoload/*.module.php') as $moduleFile) {
39 39
         $addModules = require $moduleFile;
40 40
         foreach ($addModules as $addModule) {
41 41
             if (strpos($addModule, '-') === 0) {
42
-                $remove = substr($addModule,1);
43
-                $modules = array_filter($modules, function ($elem) use ($remove) { return strcasecmp($elem,$remove); });
42
+                $remove = substr($addModule, 1);
43
+                $modules = array_filter($modules, function($elem) use ($remove) { return strcasecmp($elem, $remove); });
44 44
             }
45 45
             else {
46 46
                 if (!in_array($addModule, $modules)) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     ),
94 94
 );
95 95
 
96
-$envConfigFile = __DIR__ . '/config.' . $env . '.php';
96
+$envConfigFile = __DIR__.'/config.'.$env.'.php';
97 97
 if (file_exists($envConfigFile)) {
98 98
     if (is_readable($envConfigFile)) {
99 99
         $envConfig = include $envConfigFile;
Please login to merge, or discard this patch.
module/Install/src/Tracy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function register(array $config)
28 28
     {
29
-    	try{
29
+    	try {
30 30
 		    // enable logging of all error types globally
31 31
 		    Debugger::enable($config['mode'], $config['log'], $config['email']);
32 32
 		    Debugger::$strictMode = $config['strict'];
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		    /** @var \Tracy\Logger $logger */
36 36
 		    $logger = Debugger::getLogger();
37 37
 		    $logger->emailSnooze = $config['email_snooze'];
38
-	    }catch (\Exception $e){
38
+	    } catch (\Exception $e) {
39 39
     		throw $e;
40 40
 	    }
41 41
      
Please login to merge, or discard this patch.
module/Install/src/Factory/Controller/LazyControllerFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,25 +28,25 @@  discard block
 block discarded – undo
28 28
 		Translator::class => 'translator',
29 29
 	];
30 30
 	
31
-	public function canCreate( ContainerInterface $container, $requestedName )
31
+	public function canCreate(ContainerInterface $container, $requestedName)
32 32
 	{
33
-		list( $module, ) = explode( '\\', __NAMESPACE__, 2 );
34
-		return strstr( $requestedName, $module . '\Controller') !== false;
33
+		list($module,) = explode('\\', __NAMESPACE__, 2);
34
+		return strstr($requestedName, $module.'\Controller') !== false;
35 35
 	}
36 36
 	
37
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
37
+	public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
38 38
 	{
39 39
 		$class = new \ReflectionClass($requestedName);
40 40
 		$parentLocator = $container;
41
-		if( $constructor = $class->getConstructor() )
41
+		if ($constructor = $class->getConstructor())
42 42
 		{
43
-			if( $params = $constructor->getParameters() )
43
+			if ($params = $constructor->getParameters())
44 44
 			{
45 45
 				$parameter_instances = [];
46
-				foreach( $params as $p )
46
+				foreach ($params as $p)
47 47
 				{
48 48
 					
49
-					if( $p->getClass() ) {
49
+					if ($p->getClass()) {
50 50
 						$cn = $p->getClass()->getName();
51 51
 						if (array_key_exists($cn, $this->aliases)) {
52 52
 							$cn = $this->aliases[$cn];
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 							exit;
62 62
 						}
63 63
 					}
64
-					else{
65
-						if( $p->isArray() && $p->getName() == 'config' )
64
+					else {
65
+						if ($p->isArray() && $p->getName() == 'config')
66 66
 							$parameter_instances[] = $parentLocator->get('config');
67 67
 					}
68 68
 					
Please login to merge, or discard this patch.
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/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/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.