Completed
Pull Request — develop (#462)
by ANTHONIUS
07:17
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.
module/Applications/src/Applications/Controller/ManageController.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -54,6 +54,7 @@
 block discarded – undo
54 54
 	 * ManageController constructor.
55 55
 	 *
56 56
 	 * @param RepositoryService $repositories
57
+	 * @param ContainerInterface $container
57 58
 	 */
58 59
 	public function __construct(
59 60
 		RepositoryService $repositories,
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -30,70 +30,70 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class ManageController extends AbstractActionController
32 32
 {
33
-	/**
34
-	 * @var RepositoryService
35
-	 */
36
-	private $repositories;
33
+    /**
34
+     * @var RepositoryService
35
+     */
36
+    private $repositories;
37 37
 	
38
-	/**
39
-	 * @var
40
-	 */
41
-	private $coreNavigation;
38
+    /**
39
+     * @var
40
+     */
41
+    private $coreNavigation;
42 42
 	
43
-	private $forms;
43
+    private $forms;
44 44
 	
45
-	private $appOptions;
45
+    private $appOptions;
46 46
 	
47
-	private $appEvents;
47
+    private $appEvents;
48 48
 	
49
-	private $translator;
49
+    private $translator;
50 50
 	
51
-	private $container;
51
+    private $container;
52 52
 	
53
-	/**
54
-	 * ManageController constructor.
55
-	 *
56
-	 * @param RepositoryService $repositories
57
-	 */
58
-	public function __construct(
59
-		RepositoryService $repositories,
60
-		$coreNavigation,
61
-		$forms,
62
-		$appOptions,
63
-		$appEvents,
64
-		$translator,
65
-		$container
66
-	)
67
-	{
68
-		$this->repositories     = $repositories;
69
-		$this->coreNavigation   = $coreNavigation;
70
-		$this->forms            = $forms;
71
-		$this->appOptions       = $appOptions;
72
-		$this->appEvents        = $appEvents;
73
-		$this->translator       = $translator;
74
-		$this->container         = $container;
75
-	}
53
+    /**
54
+     * ManageController constructor.
55
+     *
56
+     * @param RepositoryService $repositories
57
+     */
58
+    public function __construct(
59
+        RepositoryService $repositories,
60
+        $coreNavigation,
61
+        $forms,
62
+        $appOptions,
63
+        $appEvents,
64
+        $translator,
65
+        $container
66
+    )
67
+    {
68
+        $this->repositories     = $repositories;
69
+        $this->coreNavigation   = $coreNavigation;
70
+        $this->forms            = $forms;
71
+        $this->appOptions       = $appOptions;
72
+        $this->appEvents        = $appEvents;
73
+        $this->translator       = $translator;
74
+        $this->container         = $container;
75
+    }
76 76
 	
77
-	/**
78
-	 * @param ContainerInterface $container
79
-	 *
80
-	 * @return ManageController
81
-	 */
82
-	static public function factory(ContainerInterface $container)
83
-	{
84
-		$ob = new self(
85
-			$container->get('Core/RepositoryService'),
86
-			$container->get('Core/Navigation'),
87
-			$container->get('forms'),
88
-			$container->get('Applications/Options'),
89
-			$container->get('Applications/Events'),
90
-			$container->get('translator'),
91
-			$container
92
-		);
93
-		return $ob;
94
-	}
77
+    /**
78
+     * @param ContainerInterface $container
79
+     *
80
+     * @return ManageController
81
+     */
82
+    static public function factory(ContainerInterface $container)
83
+    {
84
+        $ob = new self(
85
+            $container->get('Core/RepositoryService'),
86
+            $container->get('Core/Navigation'),
87
+            $container->get('forms'),
88
+            $container->get('Applications/Options'),
89
+            $container->get('Applications/Events'),
90
+            $container->get('translator'),
91
+            $container
92
+        );
93
+        return $ob;
94
+    }
95 95
 	
96
-	/**
96
+    /**
97 97
      * (non-PHPdoc)
98 98
      * @see \Zend\Mvc\Controller\AbstractActionController::onDispatch()
99 99
      */
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $application->changeStatus(
165 165
                 $application->getStatus(),
166 166
                 sprintf(/*@translate*/ 'Application was read by %s',
167
-                                       $this->auth()->getUser()->getInfo()->getDisplayName()));
167
+                                        $this->auth()->getUser()->getInfo()->getDisplayName()));
168 168
         }
169 169
 
170 170
 
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
                         $viewModel->setVariables(
192 192
                             /*array(
193 193
                             'application' => */$this->builders
194
-                                              ->get('JsonApplication')
195
-                                              ->unbuild($application)
194
+                                                ->get('JsonApplication')
195
+                                                ->unbuild($application)
196 196
                         );
197 197
                         $viewModel->setVariable('isUnread', $applicationIsUnread);
198 198
                         $return = $viewModel;
199 199
                 break;
200 200
             case 'pdf':
201
-            	// @TODO: [ZF3] Refactor this so we can inject Core/Html2Pdf service during controller creation
202
-	            $pdf = $this->container->get('Core/Html2Pdf');
201
+                // @TODO: [ZF3] Refactor this so we can inject Core/Html2Pdf service during controller creation
202
+                $pdf = $this->container->get('Core/Html2Pdf');
203 203
                 $return['format'] = $format;
204 204
                 break;
205 205
             default:
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
 
357 357
         /* @var ApplicationEvent $event */
358 358
         $event = $events->getEvent(ApplicationEvent::EVENT_APPLICATION_STATUS_CHANGE,
359
-                                   $this,
360
-                                   [
361
-                                       'application' => $application,
362
-                                       'status' => $status,
363
-                                       'user' => $this->auth()->getUser(),
364
-                                   ]
359
+                                    $this,
360
+                                    [
361
+                                        'application' => $application,
362
+                                        'status' => $status,
363
+                                        'user' => $this->auth()->getUser(),
364
+                                    ]
365 365
         );
366 366
         
367 367
         $event->setIsPostRequest($request->isPost());
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         $emailAddress = $this->params()->fromQuery('email');
412 412
         /* @var \Applications\Entity\Application $application */
413 413
         $application  = $this->repositories->get('Applications/Application')
414
-                                 ->find($this->params('id'));
414
+                                    ->find($this->params('id'));
415 415
         
416 416
         $this->acl($application, 'forward');
417 417
         
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$this->appOptions       = $appOptions;
72 72
 		$this->appEvents        = $appEvents;
73 73
 		$this->translator       = $translator;
74
-		$this->container         = $container;
74
+		$this->container = $container;
75 75
 	}
76 76
 	
77 77
 	/**
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
 
171 171
         
172
-        $format=$this->params()->fromQuery('format');
172
+        $format = $this->params()->fromQuery('format');
173 173
 
174 174
         if ($application->isDraft()) {
175 175
             $list = false;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                    && ($network = $this->params()->fromQuery('network'))
298 298
                    && ($data    = $this->params()->fromPost('data'))
299 299
         ) {
300
-            $profileClass = '\\Auth\\Entity\\SocialProfiles\\' . $network;
300
+            $profileClass = '\\Auth\\Entity\\SocialProfiles\\'.$network;
301 301
             $profile      = new $profileClass();
302 302
             $profile->setData(\Zend\Json\Json::decode($data, \Zend\Json\Json::TYPE_ARRAY));
303 303
         } else {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         
367 367
         $event->setIsPostRequest($request->isPost());
368 368
         $event->setPostData($request->getPost());
369
-        $events->trigger($event->getName(),$event);
369
+        $events->trigger($event->getName(), $event);
370 370
 
371 371
         $params = $event->getFormData();
372 372
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         
416 416
         $this->acl($application, 'forward');
417 417
         
418
-        $translator   = $this->translator;
418
+        $translator = $this->translator;
419 419
          
420 420
         if (!$emailAddress) {
421 421
             throw new \InvalidArgumentException('An email address must be supplied.');
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
     public function deleteAction()
456 456
     {
457 457
         $id          = $this->params('id');
458
-        $repositories= $this->repositories;
458
+        $repositories = $this->repositories;
459 459
         $repository  = $repositories->get('Applications/Application');
460 460
         $application = $repository->find($id);
461 461
         
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 
466 466
         $this->acl($application, 'delete');
467 467
 
468
-        $events   = $this->appEvents;
469
-        $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, [ 'application' => $application ]);
468
+        $events = $this->appEvents;
469
+        $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, ['application' => $application]);
470 470
         
471 471
         $repositories->remove($application);
472 472
         
Please login to merge, or discard this patch.
module/Auth/src/Auth/Factory/Service/RegisterConfirmationFactory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      * @param  string             $requestedName
26 26
      * @param  null|array         $options
27 27
      *
28
-     * @return object
28
+     * @return RegisterConfirmation
29 29
      * @throws ServiceNotFoundException if unable to resolve the service.
30 30
      * @throws ServiceNotCreatedException if an exception is raised when
31 31
      *     creating a service.
Please login to merge, or discard this patch.
module/Auth/src/Auth/Factory/Service/UserUniqueTokenGeneratorFactory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * @param  string             $requestedName
25 25
      * @param  null|array         $options
26 26
      *
27
-     * @return object
27
+     * @return UserUniqueTokenGenerator
28 28
      * @throws ServiceNotFoundException if unable to resolve the service.
29 29
      * @throws ServiceNotCreatedException if an exception is raised when
30 30
      *     creating a service.
Please login to merge, or discard this patch.
module/Behat/src/Select2Context.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,6 +31,7 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
33 33
 	 * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
34
+	 * @param string $field
34 35
 	 */
35 36
 	public function iFillInSelect2Field($field, $value)
36 37
 	{
@@ -42,7 +43,7 @@  discard block
 block discarded – undo
42 43
 	
43 44
 	/**
44 45
 	 * @When I fill in select2 search :field with :search and I choose :choice
45
-	 * @param $field
46
+	 * @param string $field
46 47
 	 * @param $value
47 48
 	 */
48 49
 	public function iFillInSelect2FieldWith($field,$search,$choice=null)
Please login to merge, or discard this patch.
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -24,130 +24,130 @@
 block discarded – undo
24 24
  */
25 25
 class Select2Context extends RawMinkContext implements Context
26 26
 {
27
-	protected $timeout = 5;
27
+    protected $timeout = 5;
28 28
 	
29
-	/**
30
-	 * Fills in Select2 field with specified
31
-	 *
32
-	 * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
33
-	 * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
34
-	 */
35
-	public function iFillInSelect2Field($field, $value)
36
-	{
37
-		$page = $this->getSession()->getPage();
29
+    /**
30
+     * Fills in Select2 field with specified
31
+     *
32
+     * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
33
+     * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
34
+     */
35
+    public function iFillInSelect2Field($field, $value)
36
+    {
37
+        $page = $this->getSession()->getPage();
38 38
 		
39
-		$this->openField($page, $field);
40
-		$this->selectValue($page, $field, $value, $this->timeout);
41
-	}
39
+        $this->openField($page, $field);
40
+        $this->selectValue($page, $field, $value, $this->timeout);
41
+    }
42 42
 	
43
-	/**
44
-	 * @When I fill in select2 search :field with :search and I choose :choice
45
-	 * @param $field
46
-	 * @param $value
47
-	 */
48
-	public function iFillInSelect2FieldWith($field,$search,$choice=null)
49
-	{
50
-		$page = $this->getSession()->getPage();
51
-		$this->openField($page, $field);
52
-		$this->fillSearchField($page,$field,$search);
53
-		$this->selectValue($page, $field, $choice);
54
-	}
43
+    /**
44
+     * @When I fill in select2 search :field with :search and I choose :choice
45
+     * @param $field
46
+     * @param $value
47
+     */
48
+    public function iFillInSelect2FieldWith($field,$search,$choice=null)
49
+    {
50
+        $page = $this->getSession()->getPage();
51
+        $this->openField($page, $field);
52
+        $this->fillSearchField($page,$field,$search);
53
+        $this->selectValue($page, $field, $choice);
54
+    }
55 55
 	
56
-	/**
57
-	 * Fill Select2 search field
58
-	 *
59
-	 * @param DocumentElement $page
60
-	 * @param string          $field
61
-	 * @param string          $value
62
-	 * @throws \Exception
63
-	 */
64
-	private function fillSearchField(DocumentElement $page, $field, $value)
65
-	{
66
-		$driver = $this->getSession()->getDriver();
67
-		if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) {
68
-			// Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188
56
+    /**
57
+     * Fill Select2 search field
58
+     *
59
+     * @param DocumentElement $page
60
+     * @param string          $field
61
+     * @param string          $value
62
+     * @throws \Exception
63
+     */
64
+    private function fillSearchField(DocumentElement $page, $field, $value)
65
+    {
66
+        $driver = $this->getSession()->getDriver();
67
+        if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) {
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');
71
-			$xpath = $element->getXpath();
72
-			$select2Input = $this->getSession()
73
-				->getDriver()
74
-				->getWebDriverSession()
75
-				->element('xpath',$xpath)
76
-				//->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]")
77
-			;
78
-			if (!$select2Input) {
79
-				throw new \Exception(sprintf('No field "%s" found', $field));
80
-			}
70
+            $element = $page->find('css','.select2-container--open .select2-search__field');
71
+            $xpath = $element->getXpath();
72
+            $select2Input = $this->getSession()
73
+                ->getDriver()
74
+                ->getWebDriverSession()
75
+                ->element('xpath',$xpath)
76
+                //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]")
77
+            ;
78
+            if (!$select2Input) {
79
+                throw new \Exception(sprintf('No field "%s" found', $field));
80
+            }
81 81
 			
82
-			$select2Input->postValue(['value' => [$value]]);
83
-		} else {
84
-			$select2Input = $page->find('css', '.select2-search__field');
85
-			if (!$select2Input) {
86
-				throw new \Exception(sprintf('No input found for "%s"', $field));
87
-			}
88
-			$select2Input->setValue($value);
89
-		}
82
+            $select2Input->postValue(['value' => [$value]]);
83
+        } else {
84
+            $select2Input = $page->find('css', '.select2-search__field');
85
+            if (!$select2Input) {
86
+                throw new \Exception(sprintf('No input found for "%s"', $field));
87
+            }
88
+            $select2Input->setValue($value);
89
+        }
90 90
 		
91
-		$this->waitForLoadingResults($this->timeout);
92
-	}
91
+        $this->waitForLoadingResults($this->timeout);
92
+    }
93 93
 	
94
-	/**
95
-	 * Select value in choice list
96
-	 *
97
-	 * @param DocumentElement $page
98
-	 * @param string          $field
99
-	 * @param string          $value
100
-	 * @param int             $time
101
-	 * @throws \Exception
102
-	 */
103
-	private function selectValue(DocumentElement $page, $field, $value, $time=5)
104
-	{
105
-		$this->waitForLoadingResults($time);
94
+    /**
95
+     * Select value in choice list
96
+     *
97
+     * @param DocumentElement $page
98
+     * @param string          $field
99
+     * @param string          $value
100
+     * @param int             $time
101
+     * @throws \Exception
102
+     */
103
+    private function selectValue(DocumentElement $page, $field, $value, $time=5)
104
+    {
105
+        $this->waitForLoadingResults($time);
106 106
 		
107
-		$chosenResults = $page->findAll('css', '.select2-results li');
108
-		foreach ($chosenResults as $result) {
109
-			$text = $result->getText();
110
-			if (false!==strpos($text,$value)) {
111
-				$result->click();
112
-				return;
113
-			}
114
-		}
107
+        $chosenResults = $page->findAll('css', '.select2-results li');
108
+        foreach ($chosenResults as $result) {
109
+            $text = $result->getText();
110
+            if (false!==strpos($text,$value)) {
111
+                $result->click();
112
+                return;
113
+            }
114
+        }
115 115
 		
116
-		throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field));
117
-	}
116
+        throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field));
117
+    }
118 118
 	
119
-	private function openField(DocumentElement $page, $field)
120
-	{
121
-		$inputField = $page->find('css',$field);
122
-		if(!$inputField){
123
-			$fieldName = sprintf('select[name="%s"] + .select2-container', $field);
124
-			$inputField = $page->find('css', $fieldName);
125
-		}
126
-		if (!$inputField) {
127
-			throw new \Exception(sprintf('No field "%s" found', $field));
128
-		}
119
+    private function openField(DocumentElement $page, $field)
120
+    {
121
+        $inputField = $page->find('css',$field);
122
+        if(!$inputField){
123
+            $fieldName = sprintf('select[name="%s"] + .select2-container', $field);
124
+            $inputField = $page->find('css', $fieldName);
125
+        }
126
+        if (!$inputField) {
127
+            throw new \Exception(sprintf('No field "%s" found', $field));
128
+        }
129 129
 		
130
-		$choice = $inputField->find('css', '.select2-selection');
131
-		if (!$choice) {
132
-			throw new \Exception(sprintf('No select2 choice found for "%s"', $field));
133
-		}
134
-		$choice->press();
135
-	}
130
+        $choice = $inputField->find('css', '.select2-selection');
131
+        if (!$choice) {
132
+            throw new \Exception(sprintf('No select2 choice found for "%s"', $field));
133
+        }
134
+        $choice->press();
135
+    }
136 136
 	
137
-	/**
138
-	 * Wait the end of fetching Select2 results
139
-	 *
140
-	 * @param int $time Time to wait in seconds
141
-	 */
142
-	private function waitForLoadingResults($time)
143
-	{
144
-		for ($i = 0; $i < $time; $i++) {
145
-			if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) {
146
-				return;
147
-			}
137
+    /**
138
+     * Wait the end of fetching Select2 results
139
+     *
140
+     * @param int $time Time to wait in seconds
141
+     */
142
+    private function waitForLoadingResults($time)
143
+    {
144
+        for ($i = 0; $i < $time; $i++) {
145
+            if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) {
146
+                return;
147
+            }
148 148
 			
149
-			sleep(1);
150
-		}
151
-	}
149
+            sleep(1);
150
+        }
151
+    }
152 152
 	
153 153
 }
154 154
\ No newline at end of file
Please login to merge, or discard this 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/UserContext.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,6 +198,9 @@  discard block
 block discarded – undo
198 198
 		$this->startLogin($user,'test');
199 199
 	}
200 200
 	
201
+	/**
202
+	 * @param string $password
203
+	 */
201 204
 	private function startLogin(UserInterface $user, $password)
202 205
 	{
203 206
 		$currentUser = $this->currentUser;
@@ -242,7 +245,7 @@  discard block
 block discarded – undo
242 245
 	 * @param string $fullname
243 246
 	 * @param string $role
244 247
 	 *
245
-	 * @return \Auth\Entity\UserInterface
248
+	 * @return \Core\Entity\EntityInterface
246 249
 	 */
247 250
 	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
248 251
 	{
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected $currentUser;
65 65
 	
66
-	public function __construct($parameters=[])
66
+	public function __construct($parameters = [])
67 67
 	{
68 68
 		$defaultLoginInfo = [
69 69
 			'facebook' => [
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76 76
 			],
77 77
 		];
78
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
79
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
78
+		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : [];
79
+		$this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig);
80 80
 	}
81 81
 
82 82
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             'Auth\Entity\UserImage',
99 99
             'Organizations\Entity\OrganizationName',
100 100
         ];
101
-        foreach($documents as $document){
101
+        foreach ($documents as $document) {
102 102
             $dm->createQueryBuilder($document)
103 103
                 ->remove()
104 104
                 ->getQuery()
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	{
127 127
 		$provider = strtolower($provider);
128 128
 		$mink = $this->minkContext;
129
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
130
-			$mink->fillField($field,$value);
129
+		foreach ($this->socialLoginInfo[$provider] as $field=>$value) {
130
+			$mink->fillField($field, $value);
131 131
 		}
132 132
 	}
133 133
 	
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
 	 * @Given I am logged in as a recruiter
136 136
 	 * @Given I am logged in as a recruiter with :organization as organization
137 137
 	 */
138
-	public function iAmLoggedInAsARecruiter($organization=null)
138
+	public function iAmLoggedInAsARecruiter($organization = null)
139 139
 	{
140 140
 		$user = $this->thereIsAUserIdentifiedBy(
141 141
 			'[email protected]',
142
-			'test',User::ROLE_RECRUITER,
142
+			'test', User::ROLE_RECRUITER,
143 143
 			'Test Recruiter',
144 144
 			$organization
145 145
 		);
146
-		$this->startLogin($user,'test');
147
-		if(!is_null($organization)){
148
-            $this->iHaveMainOrganization($user,$organization);
146
+		$this->startLogin($user, 'test');
147
+		if (!is_null($organization)) {
148
+            $this->iHaveMainOrganization($user, $organization);
149 149
         }
150 150
 	}
151 151
 	
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 	public function iDonTHaveUser($login)
157 157
 	{
158 158
 		$repo = $this->getUserRepository();
159
-		$user=$repo->findByLogin($login);
160
-		if($user instanceof UserInterface){
161
-			$repo->remove($user,true);
159
+		$user = $repo->findByLogin($login);
160
+		if ($user instanceof UserInterface) {
161
+			$repo->remove($user, true);
162 162
 		}
163 163
 	}
164 164
 	
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @param $role
168 168
 	 * @param TableNode $fields
169 169
 	 */
170
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
170
+	public function iHaveUserWithTheFollowing($role, TableNode $fields)
171 171
 	{
172 172
 		$normalizedFields = [
173 173
 			'login' => '[email protected]',
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 			'password' => 'test',
177 177
 			'organization' => 'Cross Solution'
178 178
 		];
179
-		foreach($fields->getRowsHash() as $field=>$value){
179
+		foreach ($fields->getRowsHash() as $field=>$value) {
180 180
 			$field = Inflector::camelize($field);
181 181
 			$normalizedFields[$field] = $value;
182 182
 		}
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	public function iAmLoggedInAsAnAdmin()
198 198
 	{
199
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
200
-		$this->startLogin($user,'test');
199
+		$user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN);
200
+		$this->startLogin($user, 'test');
201 201
 	}
202 202
 	
203 203
 	private function startLogin(UserInterface $user, $password)
204 204
 	{
205 205
 		$currentUser = $this->currentUser;
206
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
206
+		if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) {
207 207
 			$this->iWantToLogIn();
208 208
 			$this->iSpecifyTheUsernameAs($user->getLogin());
209 209
 			$this->iSpecifyThePasswordAs($password);
@@ -223,15 +223,15 @@  discard block
 block discarded – undo
223 223
 	/**
224 224
 	 * @Given there is a user :email identified by :password
225 225
 	 */
226
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
226
+	public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null)
227 227
 	{
228 228
 		$repo = $this->getUserRepository();
229
-		if(!is_object($user=$repo->findByEmail($email))){
230
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
229
+		if (!is_object($user = $repo->findByEmail($email))) {
230
+			$user = $this->createUser($email, $password, $role, $fullname, $organization);
231 231
 		}
232 232
 		
233
-		if(!is_null($organization)){
234
-			$this->iHaveMainOrganization($user,$organization);
233
+		if (!is_null($organization)) {
234
+			$this->iHaveMainOrganization($user, $organization);
235 235
 		}
236 236
 		$this->addCreatedUser($user);
237 237
 		$repo->getDocumentManager()->refresh($user);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @return \Auth\Entity\UserInterface
249 249
 	 */
250
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
250
+	public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter")
251 251
 	{
252 252
 		/* @var Register $service */
253 253
 		/* @var User $user */
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 		$user->setRole($role);
259 259
 		$settings = $user->getSettings('Applications');
260 260
 		
261
-		$expFullName = explode(' ',$fullname);
261
+		$expFullName = explode(' ', $fullname);
262 262
 		$info = $user->getInfo();
263 263
 		$info->setFirstName(array_shift($expFullName));
264
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
264
+		$info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : '');
265 265
 		$info->setEmail($email);
266 266
 		$info->setEmailVerified(true);
267 267
 		$repo->store($user);
@@ -286,20 +286,20 @@  discard block
 block discarded – undo
286 286
 	 * @When I have :organization as my main organization
287 287
 	 * @param $orgName
288 288
 	 */
289
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
289
+	public function iHaveMainOrganization(UserInterface $user, $orgName)
290 290
 	{
291 291
 		/* @var $repoOrganization OrganizationRepository */
292 292
 		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
293 293
 		$result = $repoOrganization->findByName($orgName);
294
-		$organization = count($result) > 0 ? $result[0]:null;
295
-		if(!$organization instanceof Organization){
294
+		$organization = count($result) > 0 ? $result[0] : null;
295
+		if (!$organization instanceof Organization) {
296 296
 			$organization = new Organization();
297 297
 			$organizationName = new OrganizationName($orgName);
298 298
 			$organization->setOrganizationName($organizationName);
299 299
 		}
300 300
         $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE);
301 301
         $permissions = $organization->getPermissions();
302
-        $permissions->grant($user,Permissions::PERMISSION_ALL);
302
+        $permissions->grant($user, Permissions::PERMISSION_ALL);
303 303
 
304 304
         $organization->setUser($user);
305 305
         $repoOrganization->store($organization);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 */
333 333
 	public function iSpecifyTheUsernameAs($username)
334 334
 	{
335
-		$this->minkContext->fillField('Login name',$username);
335
+		$this->minkContext->fillField('Login name', $username);
336 336
 	}
337 337
 	
338 338
 	/**
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	 */
341 341
 	public function iSpecifyThePasswordAs($password)
342 342
 	{
343
-		$this->minkContext->fillField('Password',$password);
343
+		$this->minkContext->fillField('Password', $password);
344 344
 	}
345 345
 	
346 346
 	/**
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 		$repo = $this->getUserRepository();
352 352
 		$user = $repo->findByLogin($username);
353 353
 		
354
-		if(!$user instanceof User){
355
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
354
+		if (!$user instanceof User) {
355
+			throw new \Exception(sprintf('There is no user with this login: "%s"', $username));
356 356
 		}
357 357
 		$this->iWantToLogIn();
358 358
 		$this->iSpecifyTheUsernameAs($username);
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
 	{
409 409
 		$repo = $this->getUserRepository();
410 410
 		$data = $table->getRowsHash();
411
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
412
-		$password = isset($data['password']) ? $data['password']:'test';
413
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
414
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
411
+		$email = isset($data['email']) ? $data['email'] : '[email protected]';
412
+		$password = isset($data['password']) ? $data['password'] : 'test';
413
+		$fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User';
414
+		$role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER;
415 415
 		
416
-		if(!is_object($user=$repo->findByLogin($email))){
417
-			$user = $this->createUser($email,$password,$role,$fullname);
416
+		if (!is_object($user = $repo->findByLogin($email))) {
417
+			$user = $this->createUser($email, $password, $role, $fullname);
418 418
 		}
419 419
 		$this->currentUser = $user;
420 420
 		$this->addCreatedUser($user);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	
423 423
 	private function addCreatedUser(UserInterface $user)
424 424
 	{
425
-		if(!in_array($user,static::$users)){
425
+		if (!in_array($user, static::$users)) {
426 426
 			static::$users[] = $user;
427 427
 		}
428 428
 	}
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
      */
443 443
 	public function getCurrentUser()
444 444
     {
445
-        if(!$this->currentUser instanceof User){
445
+        if (!$this->currentUser instanceof User) {
446 446
             throw new FailedExpectationException('Need to login first before use this step');
447 447
         }
448 448
         return $this->currentUser;
Please login to merge, or discard this patch.
Indentation   +312 added lines, -312 removed lines patch added patch discarded remove patch
@@ -31,60 +31,60 @@  discard block
 block discarded – undo
31 31
 {
32 32
     use CommonContextTrait;
33 33
 	
34
-	/**
35
-	 * @var User[]
36
-	 */
37
-	static private $users = [];
34
+    /**
35
+     * @var User[]
36
+     */
37
+    static private $users = [];
38 38
 	
39
-	/**
40
-	 * @var UserRepository
41
-	 */
42
-	static private $userRepo;
39
+    /**
40
+     * @var UserRepository
41
+     */
42
+    static private $userRepo;
43 43
 	
44
-	private $socialLoginInfo = [];
44
+    private $socialLoginInfo = [];
45 45
 
46 46
     /**
47 47
      * @var DocumentManager
48 48
      */
49
-	static private $dm;
49
+    static private $dm;
50 50
 	
51
-	/**
52
-	 * @var UserInterface
53
-	 */
54
-	private $loggedInUser;
51
+    /**
52
+     * @var UserInterface
53
+     */
54
+    private $loggedInUser;
55 55
 
56 56
     /**
57 57
      * @var Organization
58 58
      */
59
-	private $mainOrganization;
59
+    private $mainOrganization;
60 60
 
61 61
     /**
62 62
      * @var User
63 63
      */
64 64
     protected $currentUser;
65 65
 	
66
-	public function __construct($parameters=[])
67
-	{
68
-		$defaultLoginInfo = [
69
-			'facebook' => [
70
-				'email' => getenv('FACEBOOK_USER_EMAIL'),
71
-				'pass' => getenv('FACEBOOK_USER_PASSWORD')
72
-			],
73
-			'linkedin' => [
74
-				'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
75
-				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76
-			],
77
-		];
78
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
79
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
80
-	}
66
+    public function __construct($parameters=[])
67
+    {
68
+        $defaultLoginInfo = [
69
+            'facebook' => [
70
+                'email' => getenv('FACEBOOK_USER_EMAIL'),
71
+                'pass' => getenv('FACEBOOK_USER_PASSWORD')
72
+            ],
73
+            'linkedin' => [
74
+                'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
75
+                'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76
+            ],
77
+        ];
78
+        $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
79
+        $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
80
+    }
81 81
 
82 82
     /**
83 83
      * Empty all data every each tests
84 84
      *
85 85
      * @AfterSuite
86 86
      */
87
-	static public function tearDown()
87
+    static public function tearDown()
88 88
     {
89 89
         $dm = static::$dm;
90 90
 
@@ -107,54 +107,54 @@  discard block
 block discarded – undo
107 107
         }
108 108
     }
109 109
 
110
-	/**
111
-	 * @BeforeScenario
112
-	 * @param BeforeScenarioScope $scope
113
-	 */
114
-	public function beforeScenario(BeforeScenarioScope $scope)
115
-	{
116
-		$this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
117
-		$this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
118
-		static::$userRepo = $this->getUserRepository();
119
-		static::$dm = $this->getUserRepository()->getDocumentManager();
120
-	}
110
+    /**
111
+     * @BeforeScenario
112
+     * @param BeforeScenarioScope $scope
113
+     */
114
+    public function beforeScenario(BeforeScenarioScope $scope)
115
+    {
116
+        $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
117
+        $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
118
+        static::$userRepo = $this->getUserRepository();
119
+        static::$dm = $this->getUserRepository()->getDocumentManager();
120
+    }
121 121
 	
122
-	/**
123
-	 * @When I fill in login form with :provider user
124
-	 */
125
-	public function iSignInWithSocialUser($provider)
126
-	{
127
-		$provider = strtolower($provider);
128
-		$mink = $this->minkContext;
129
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
130
-			$mink->fillField($field,$value);
131
-		}
132
-	}
122
+    /**
123
+     * @When I fill in login form with :provider user
124
+     */
125
+    public function iSignInWithSocialUser($provider)
126
+    {
127
+        $provider = strtolower($provider);
128
+        $mink = $this->minkContext;
129
+        foreach($this->socialLoginInfo[$provider] as $field=>$value){
130
+            $mink->fillField($field,$value);
131
+        }
132
+    }
133 133
 	
134
-	/**
135
-	 * @Given I am logged in as a recruiter
136
-	 * @Given I am logged in as a recruiter with :organization as organization
137
-	 */
138
-	public function iAmLoggedInAsARecruiter($organization=null)
139
-	{
140
-		$user = $this->thereIsAUserIdentifiedBy(
141
-			'[email protected]',
142
-			'test',User::ROLE_RECRUITER,
143
-			'Test Recruiter',
144
-			$organization
145
-		);
146
-		$this->startLogin($user,'test');
147
-		if(!is_null($organization)){
134
+    /**
135
+     * @Given I am logged in as a recruiter
136
+     * @Given I am logged in as a recruiter with :organization as organization
137
+     */
138
+    public function iAmLoggedInAsARecruiter($organization=null)
139
+    {
140
+        $user = $this->thereIsAUserIdentifiedBy(
141
+            '[email protected]',
142
+            'test',User::ROLE_RECRUITER,
143
+            'Test Recruiter',
144
+            $organization
145
+        );
146
+        $this->startLogin($user,'test');
147
+        if(!is_null($organization)){
148 148
             $this->iHaveMainOrganization($user,$organization);
149 149
         }
150
-	}
150
+    }
151 151
 
152 152
     /**
153 153
      * @Given I have user with the following:
154 154
      *
155 155
      *
156 156
      */
157
-	public function iHaveRecruiterWithOrganization(TableNode $tableNode)
157
+    public function iHaveRecruiterWithOrganization(TableNode $tableNode)
158 158
     {
159 159
         $rows = $tableNode->getRowsHash();
160 160
 
@@ -177,154 +177,154 @@  discard block
 block discarded – undo
177 177
     }
178 178
 
179 179
 	
180
-	/**
181
-	 * @Given I don't have :login user
182
-	 * @param string $login
183
-	 */
184
-	public function iDonTHaveUser($login)
185
-	{
186
-		$repo = $this->getUserRepository();
187
-		$user=$repo->findByLogin($login);
188
-		if($user instanceof UserInterface){
189
-			$repo->remove($user,true);
190
-		}
191
-	}
180
+    /**
181
+     * @Given I don't have :login user
182
+     * @param string $login
183
+     */
184
+    public function iDonTHaveUser($login)
185
+    {
186
+        $repo = $this->getUserRepository();
187
+        $user=$repo->findByLogin($login);
188
+        if($user instanceof UserInterface){
189
+            $repo->remove($user,true);
190
+        }
191
+    }
192 192
 	
193
-	/**
194
-	 * @Given I have a :role with the following:
195
-	 * @param $role
196
-	 * @param TableNode $fields
197
-	 */
198
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
199
-	{
200
-		$normalizedFields = [
201
-			'login' => '[email protected]',
202
-			'fullname' => 'Test Login',
203
-			'role' => User::ROLE_USER,
204
-			'password' => 'test',
205
-			'organization' => 'Cross Solution'
206
-		];
207
-		foreach($fields->getRowsHash() as $field=>$value){
208
-			$field = Inflector::camelize($field);
209
-			$normalizedFields[$field] = $value;
210
-		}
193
+    /**
194
+     * @Given I have a :role with the following:
195
+     * @param $role
196
+     * @param TableNode $fields
197
+     */
198
+    public function iHaveUserWithTheFollowing($role,TableNode $fields)
199
+    {
200
+        $normalizedFields = [
201
+            'login' => '[email protected]',
202
+            'fullname' => 'Test Login',
203
+            'role' => User::ROLE_USER,
204
+            'password' => 'test',
205
+            'organization' => 'Cross Solution'
206
+        ];
207
+        foreach($fields->getRowsHash() as $field=>$value){
208
+            $field = Inflector::camelize($field);
209
+            $normalizedFields[$field] = $value;
210
+        }
211 211
 		
212
-		$this->thereIsAUserIdentifiedBy(
213
-			$normalizedFields['login'],
214
-			$normalizedFields['password'],
215
-			$role,
216
-			$normalizedFields['fullname'],
217
-			$normalizedFields['organization']
218
-		);
212
+        $this->thereIsAUserIdentifiedBy(
213
+            $normalizedFields['login'],
214
+            $normalizedFields['password'],
215
+            $role,
216
+            $normalizedFields['fullname'],
217
+            $normalizedFields['organization']
218
+        );
219 219
 		
220
-	}
220
+    }
221 221
 	
222
-	/**
223
-	 * @Given I am logged in as an administrator
224
-	 */
225
-	public function iAmLoggedInAsAnAdmin()
226
-	{
227
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
228
-		$this->startLogin($user,'test');
229
-	}
222
+    /**
223
+     * @Given I am logged in as an administrator
224
+     */
225
+    public function iAmLoggedInAsAnAdmin()
226
+    {
227
+        $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
228
+        $this->startLogin($user,'test');
229
+    }
230 230
 	
231
-	private function startLogin(UserInterface $user, $password)
232
-	{
233
-		$currentUser = $this->currentUser;
234
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
235
-			$this->iWantToLogIn();
236
-			$this->iSpecifyTheUsernameAs($user->getLogin());
237
-			$this->iSpecifyThePasswordAs($password);
238
-			$this->iLogIn();
239
-			$this->currentUser = $user;
240
-		}
241
-	}
231
+    private function startLogin(UserInterface $user, $password)
232
+    {
233
+        $currentUser = $this->currentUser;
234
+        if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
235
+            $this->iWantToLogIn();
236
+            $this->iSpecifyTheUsernameAs($user->getLogin());
237
+            $this->iSpecifyThePasswordAs($password);
238
+            $this->iLogIn();
239
+            $this->currentUser = $user;
240
+        }
241
+    }
242 242
 	
243
-	/**
244
-	 * @return UserRepository
245
-	 */
246
-	public function getUserRepository()
247
-	{
248
-		return $this->coreContext->getRepositories()->get('Auth\Entity\User');
249
-	}
243
+    /**
244
+     * @return UserRepository
245
+     */
246
+    public function getUserRepository()
247
+    {
248
+        return $this->coreContext->getRepositories()->get('Auth\Entity\User');
249
+    }
250 250
 	
251
-	/**
252
-	 * @Given there is a user :email identified by :password
253
-	 */
254
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
255
-	{
256
-		$repo = $this->getUserRepository();
257
-		if(!is_object($user=$repo->findByEmail($email))){
258
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
259
-		}
251
+    /**
252
+     * @Given there is a user :email identified by :password
253
+     */
254
+    public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
255
+    {
256
+        $repo = $this->getUserRepository();
257
+        if(!is_object($user=$repo->findByEmail($email))){
258
+            $user = $this->createUser($email,$password,$role,$fullname,$organization);
259
+        }
260 260
 		
261
-		if(!is_null($organization)){
262
-			$this->iHaveMainOrganization($user,$organization);
263
-		}
264
-		$this->addCreatedUser($user);
265
-		$repo->getDocumentManager()->refresh($user);
266
-		return $user;
267
-	}
261
+        if(!is_null($organization)){
262
+            $this->iHaveMainOrganization($user,$organization);
263
+        }
264
+        $this->addCreatedUser($user);
265
+        $repo->getDocumentManager()->refresh($user);
266
+        return $user;
267
+    }
268 268
 	
269
-	/**
270
-	 * @param $email
271
-	 * @param $password
272
-	 * @param $username
273
-	 * @param string $fullname
274
-	 * @param string $role
275
-	 *
276
-	 * @return \Auth\Entity\UserInterface
277
-	 */
278
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
279
-	{
280
-		/* @var Register $service */
281
-		/* @var User $user */
282
-		$repo = $this->getUserRepository();
283
-		$user = $repo->create([]);
284
-		$user->setLogin($email);
285
-		$user->setPassword($password);
286
-		$user->setRole($role);
287
-		$settings = $user->getSettings('Applications');
269
+    /**
270
+     * @param $email
271
+     * @param $password
272
+     * @param $username
273
+     * @param string $fullname
274
+     * @param string $role
275
+     *
276
+     * @return \Auth\Entity\UserInterface
277
+     */
278
+    public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
279
+    {
280
+        /* @var Register $service */
281
+        /* @var User $user */
282
+        $repo = $this->getUserRepository();
283
+        $user = $repo->create([]);
284
+        $user->setLogin($email);
285
+        $user->setPassword($password);
286
+        $user->setRole($role);
287
+        $settings = $user->getSettings('Applications');
288 288
 		
289
-		$expFullName = explode(' ',$fullname);
290
-		$info = $user->getInfo();
291
-		$info->setFirstName(array_shift($expFullName));
292
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
293
-		$info->setEmail($email);
294
-		$info->setEmailVerified(true);
295
-		$repo->store($user);
296
-		$repo->getDocumentManager()->refresh($user);
289
+        $expFullName = explode(' ',$fullname);
290
+        $info = $user->getInfo();
291
+        $info->setFirstName(array_shift($expFullName));
292
+        $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
293
+        $info->setEmail($email);
294
+        $info->setEmailVerified(true);
295
+        $repo->store($user);
296
+        $repo->getDocumentManager()->refresh($user);
297 297
 		
298
-		$eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
299
-		$repo->getDocumentManager()->getEventManager()->dispatchEvent(
300
-			Events::postLoad,
301
-			$eventArgs
302
-		);
303
-		/* @var \Core\EventManager\EventManager $events */
304
-		/* @var \Auth\Listener\Events\AuthEvent $event */
305
-		//@TODO: [Behat] event not working in travis
306
-		//$events = $this->coreContext->getEventManager();
307
-		//$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
308
-		//$event->setUser($user);
309
-		//$events->triggerEvent($event);
310
-		return $user;
311
-	}
298
+        $eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
299
+        $repo->getDocumentManager()->getEventManager()->dispatchEvent(
300
+            Events::postLoad,
301
+            $eventArgs
302
+        );
303
+        /* @var \Core\EventManager\EventManager $events */
304
+        /* @var \Auth\Listener\Events\AuthEvent $event */
305
+        //@TODO: [Behat] event not working in travis
306
+        //$events = $this->coreContext->getEventManager();
307
+        //$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
308
+        //$event->setUser($user);
309
+        //$events->triggerEvent($event);
310
+        return $user;
311
+    }
312 312
 	
313
-	/**
314
-	 * @When I have :organization as my main organization
315
-	 * @param $orgName
316
-	 */
317
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
318
-	{
319
-		/* @var $repoOrganization OrganizationRepository */
320
-		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
321
-		$result = $repoOrganization->findByName($orgName);
322
-		$organization = count($result) > 0 ? $result[0]:null;
323
-		if(!$organization instanceof Organization){
324
-			$organization = new Organization();
325
-			$organizationName = new OrganizationName($orgName);
326
-			$organization->setOrganizationName($organizationName);
327
-		}
313
+    /**
314
+     * @When I have :organization as my main organization
315
+     * @param $orgName
316
+     */
317
+    public function iHaveMainOrganization(UserInterface $user,$orgName)
318
+    {
319
+        /* @var $repoOrganization OrganizationRepository */
320
+        $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
321
+        $result = $repoOrganization->findByName($orgName);
322
+        $organization = count($result) > 0 ? $result[0]:null;
323
+        if(!$organization instanceof Organization){
324
+            $organization = new Organization();
325
+            $organizationName = new OrganizationName($orgName);
326
+            $organization->setOrganizationName($organizationName);
327
+        }
328 328
         $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE);
329 329
         $permissions = $organization->getPermissions();
330 330
         $permissions->grant($user,Permissions::PERMISSION_ALL);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         $repoOrganization->getDocumentManager()->refresh($organization);
335 335
 
336 336
         $this->mainOrganization = $organization;
337
-	}
337
+    }
338 338
 
339 339
     /**
340 340
      * @return Organization
@@ -344,130 +344,130 @@  discard block
 block discarded – undo
344 344
         return $this->mainOrganization;
345 345
     }
346 346
 
347
-	/**
348
-	 * @When I want to log in
349
-	 */
350
-	public function iWantToLogIn()
351
-	{
352
-		$session = $this->minkContext->getSession();
353
-		$url = $this->buildUrl('lang/auth');
354
-		$session->visit($url);
355
-	}
347
+    /**
348
+     * @When I want to log in
349
+     */
350
+    public function iWantToLogIn()
351
+    {
352
+        $session = $this->minkContext->getSession();
353
+        $url = $this->buildUrl('lang/auth');
354
+        $session->visit($url);
355
+    }
356 356
 	
357
-	/**
358
-	 * @When I specify the username as :username
359
-	 */
360
-	public function iSpecifyTheUsernameAs($username)
361
-	{
362
-		$this->minkContext->fillField('Login name',$username);
363
-	}
357
+    /**
358
+     * @When I specify the username as :username
359
+     */
360
+    public function iSpecifyTheUsernameAs($username)
361
+    {
362
+        $this->minkContext->fillField('Login name',$username);
363
+    }
364 364
 	
365
-	/**
366
-	 * @When I specify the password as :password
367
-	 */
368
-	public function iSpecifyThePasswordAs($password)
369
-	{
370
-		$this->minkContext->fillField('Password',$password);
371
-	}
365
+    /**
366
+     * @When I specify the password as :password
367
+     */
368
+    public function iSpecifyThePasswordAs($password)
369
+    {
370
+        $this->minkContext->fillField('Password',$password);
371
+    }
372 372
 	
373
-	/**
374
-	 * @Given I am logged in as :username identified by :password
375
-	 */
376
-	public function iAmLoggedInAsIdentifiedBy($username, $password)
377
-	{
378
-		$repo = $this->getUserRepository();
379
-		$user = $repo->findByLogin($username);
373
+    /**
374
+     * @Given I am logged in as :username identified by :password
375
+     */
376
+    public function iAmLoggedInAsIdentifiedBy($username, $password)
377
+    {
378
+        $repo = $this->getUserRepository();
379
+        $user = $repo->findByLogin($username);
380 380
 		
381
-		if(!$user instanceof User){
382
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
383
-		}
384
-		$this->iWantToLogIn();
385
-		$this->iSpecifyTheUsernameAs($username);
386
-		$this->iSpecifyThePasswordAs($password);
387
-		$this->iLogIn();
381
+        if(!$user instanceof User){
382
+            throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
383
+        }
384
+        $this->iWantToLogIn();
385
+        $this->iSpecifyTheUsernameAs($username);
386
+        $this->iSpecifyThePasswordAs($password);
387
+        $this->iLogIn();
388 388
         $this->currentUser = $user;
389
-	}
389
+    }
390 390
 	
391
-	/**
392
-	 * @When I log in
393
-	 */
394
-	public function iLogIn()
395
-	{
396
-		$this->minkContext->pressButton('login');
397
-	}
391
+    /**
392
+     * @When I log in
393
+     */
394
+    public function iLogIn()
395
+    {
396
+        $this->minkContext->pressButton('login');
397
+    }
398 398
 	
399
-	/**
400
-	 * @When I press logout link
401
-	 */
402
-	public function iPressLogoutLink()
403
-	{
404
-		$url = $this->buildUrl('auth-logout');
405
-		$this->visit($url);
406
-	}
399
+    /**
400
+     * @When I press logout link
401
+     */
402
+    public function iPressLogoutLink()
403
+    {
404
+        $url = $this->buildUrl('auth-logout');
405
+        $this->visit($url);
406
+    }
407 407
 	
408
-	/**
409
-	 * @Given I log in with username :username and password :password
410
-	 */
411
-	public function iLogInWith($username, $password)
412
-	{
413
-		$repo = $this->getUserRepository();
414
-		$user = $repo->findByLogin($username);
415
-		$this->iWantToLogIn();
416
-		$this->iSpecifyTheUsernameAs($username);
417
-		$this->iSpecifyThePasswordAs($password);
418
-		$this->iLogIn();
419
-		$this->loggedInUser = $user;
420
-	}
408
+    /**
409
+     * @Given I log in with username :username and password :password
410
+     */
411
+    public function iLogInWith($username, $password)
412
+    {
413
+        $repo = $this->getUserRepository();
414
+        $user = $repo->findByLogin($username);
415
+        $this->iWantToLogIn();
416
+        $this->iSpecifyTheUsernameAs($username);
417
+        $this->iSpecifyThePasswordAs($password);
418
+        $this->iLogIn();
419
+        $this->loggedInUser = $user;
420
+    }
421 421
 	
422
-	/**
423
-	 * @When I go to profile page
424
-	 */
425
-	public function iGoToProfilePage()
426
-	{
427
-		$url = $this->buildUrl('lang/my');
428
-		$this->visit($url);
429
-	}
422
+    /**
423
+     * @When I go to profile page
424
+     */
425
+    public function iGoToProfilePage()
426
+    {
427
+        $url = $this->buildUrl('lang/my');
428
+        $this->visit($url);
429
+    }
430 430
 	
431
-	/**
432
-	 * @Given there is a user with the following:
433
-	 */
434
-	public function thereIsAUserWithTheFollowing(TableNode $table)
435
-	{
436
-		$repo = $this->getUserRepository();
437
-		$data = $table->getRowsHash();
438
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
439
-		$password = isset($data['password']) ? $data['password']:'test';
440
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
441
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
431
+    /**
432
+     * @Given there is a user with the following:
433
+     */
434
+    public function thereIsAUserWithTheFollowing(TableNode $table)
435
+    {
436
+        $repo = $this->getUserRepository();
437
+        $data = $table->getRowsHash();
438
+        $email = isset($data['email']) ? $data['email']:'[email protected]';
439
+        $password = isset($data['password']) ? $data['password']:'test';
440
+        $fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
441
+        $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
442 442
 		
443
-		if(!is_object($user=$repo->findByLogin($email))){
444
-			$user = $this->createUser($email,$password,$role,$fullname);
445
-		}
446
-		$this->currentUser = $user;
447
-		$this->addCreatedUser($user);
448
-	}
443
+        if(!is_object($user=$repo->findByLogin($email))){
444
+            $user = $this->createUser($email,$password,$role,$fullname);
445
+        }
446
+        $this->currentUser = $user;
447
+        $this->addCreatedUser($user);
448
+    }
449 449
 	
450
-	private function addCreatedUser(UserInterface $user)
451
-	{
452
-		if(!in_array($user,static::$users)){
453
-			static::$users[] = $user;
454
-		}
455
-	}
450
+    private function addCreatedUser(UserInterface $user)
451
+    {
452
+        if(!in_array($user,static::$users)){
453
+            static::$users[] = $user;
454
+        }
455
+    }
456 456
 	
457
-	/**
458
-	 * @When I want to change my password
459
-	 */
460
-	public function iWantToChangeMyPassword()
461
-	{
462
-		$url = $this->buildUrl('lang/my-password');
463
-		$this->visit($url);
464
-	}
457
+    /**
458
+     * @When I want to change my password
459
+     */
460
+    public function iWantToChangeMyPassword()
461
+    {
462
+        $url = $this->buildUrl('lang/my-password');
463
+        $this->visit($url);
464
+    }
465 465
 
466 466
     /**
467 467
      * @return User
468 468
      * @throws FailedExpectationException
469 469
      */
470
-	public function getCurrentUser()
470
+    public function getCurrentUser()
471 471
     {
472 472
         if(!$this->currentUser instanceof User){
473 473
             throw new FailedExpectationException('Need to login first before use this step');
Please login to merge, or discard this patch.
module/Core/src/Core/Controller/Plugin/CreatePaginator.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,6 @@
 block discarded – undo
128 128
     }
129 129
     
130 130
     /**
131
-     * @param ControllerManager $controllerManager
132 131
      * @return CreatePaginator
133 132
      * @codeCoverageIgnore
134 133
      */
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected $request;
46 46
 	
47
-	/**
48
-	 * CreatePaginator constructor.
49
-	 *
50
-	 * @param ContainerInterface $container
51
-	 * @param HttpRequest $request
52
-	 */
47
+    /**
48
+     * CreatePaginator constructor.
49
+     *
50
+     * @param ContainerInterface $container
51
+     * @param HttpRequest $request
52
+     */
53 53
     public function __construct(ContainerInterface $container, HttpRequest $request)
54 54
     {
55 55
         $this->serviceManager = $container->get('ServiceManager');
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         /* @var \Core\EventManager\EventManager $events */
106 106
         /* @var \Zend\Paginator\Paginator $paginator */
107 107
         /* @var CreatePaginatorEvent $event */
108
-	    $events = $this->serviceManager->get('Core/CreatePaginator/Events');
108
+        $events = $this->serviceManager->get('Core/CreatePaginator/Events');
109 109
 
110
-	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
110
+        $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
111 111
             'paginatorParams' => $params,
112 112
             'paginators' => $paginators,
113 113
             'paginatorName' => $paginatorName
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
             $paginator = $paginators->get($paginatorName,$params);
122 122
         }
123 123
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
124
-                  ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
125
-                  ->setPageRange(isset($params['range']) ? $params['range'] : 5);
124
+                    ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
125
+                    ->setPageRange(isset($params['range']) ? $params['range'] : 5);
126 126
 
127 127
         return $paginator;
128 128
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         /* @var CreatePaginatorEvent $event */
108 108
 	    $events = $this->serviceManager->get('Core/CreatePaginator/Events');
109 109
 
110
-	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
110
+	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR, $this, [
111 111
             'paginatorParams' => $params,
112 112
             'paginators' => $paginators,
113 113
             'paginatorName' => $paginatorName
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
         $paginator = $event->getPaginator();
118 118
 
119
-        if(!$paginator instanceof Paginator){
119
+        if (!$paginator instanceof Paginator) {
120 120
             // no paginator created by listener, so let's create default paginator
121
-            $paginator = $paginators->get($paginatorName,$params);
121
+            $paginator = $paginators->get($paginatorName, $params);
122 122
         }
123 123
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
124 124
                   ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
Please login to merge, or discard this patch.
module/Core/src/Core/EventManager/EventManager.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
      *
61 61
      * If no event instance is passed, it creates one prior to triggering.
62 62
      *
63
-     * @param EventInterface|string $eventName
64
-     * @param object|string|null $target
63
+     * @param EventInterface $eventName
64
+     * @param \Core\Controller\AdminController $target
65 65
      * @param array $argv
66 66
      *
67 67
      * @return \Zend\EventManager\ResponseCollection
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
         return $event;
56 56
     }
57 57
 	
58
-	/**
59
-	 * Trigger an event.
58
+    /**
59
+     * Trigger an event.
60 60
      *
61 61
      * If no event instance is passed, it creates one prior to triggering.
62 62
      *
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param array $argv
66 66
      *
67 67
      * @return \Zend\EventManager\ResponseCollection
68
-	 */
68
+     */
69 69
     public function trigger($eventName, $target = null, $argv = [])
70 70
     {
71 71
         $event = $eventName instanceOf EventInterface
Please login to merge, or discard this patch.
module/Core/src/Core/Factory/Service/RestClientFactory.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     }
59 59
 
60 60
     /**
61
-     * @return mixed
61
+     * @return null|string
62 62
      */
63 63
     abstract protected function getUri();
64 64
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@
 block discarded – undo
38 38
      */
39 39
     protected $serviceLocator;
40 40
 	
41
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
42
-	{
43
-		$this->serviceLocator = $container;
44
-		$service = new RestClient($this->getUri(), $this->getConfig());
45
-		return $service;
46
-	}
41
+    public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
42
+    {
43
+        $this->serviceLocator = $container;
44
+        $service = new RestClient($this->getUri(), $this->getConfig());
45
+        return $service;
46
+    }
47 47
 	
48 48
 	
49
-	/**
49
+    /**
50 50
      * Create the settings service
51 51
      *
52 52
      * @param  ServiceLocatorInterface $serviceLocator
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     protected $serviceLocator;
40 40
 	
41
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
41
+	public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
42 42
 	{
43 43
 		$this->serviceLocator = $container;
44 44
 		$service = new RestClient($this->getUri(), $this->getConfig());
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function createService(ServiceLocatorInterface $serviceLocator)
56 56
     {
57
-        return $this($serviceLocator,RestClient::class);
57
+        return $this($serviceLocator, RestClient::class);
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.