@@ -22,244 +22,244 @@ |
||
22 | 22 | */ |
23 | 23 | class CoreContext extends RawMinkContext |
24 | 24 | { |
25 | - static protected $application; |
|
25 | + static protected $application; |
|
26 | 26 | |
27 | - /** |
|
28 | - * @var MinkContext |
|
29 | - */ |
|
30 | - protected $minkContext; |
|
27 | + /** |
|
28 | + * @var MinkContext |
|
29 | + */ |
|
30 | + protected $minkContext; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @BeforeScenario |
|
34 | - * @param BeforeScenarioScope $scope |
|
35 | - */ |
|
36 | - public function gatherContexts(BeforeScenarioScope $scope) |
|
37 | - { |
|
38 | - $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
39 | - } |
|
32 | + /** |
|
33 | + * @BeforeScenario |
|
34 | + * @param BeforeScenarioScope $scope |
|
35 | + */ |
|
36 | + public function gatherContexts(BeforeScenarioScope $scope) |
|
37 | + { |
|
38 | + $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return Application |
|
43 | - */ |
|
44 | - public function getApplication() |
|
45 | - { |
|
46 | - if(!is_object(static::$application)){ |
|
47 | - $configFile = realpath(__DIR__.'/../../../config/config.php'); |
|
48 | - $config = include($configFile); |
|
49 | - static::$application = Application::init($config); |
|
50 | - } |
|
51 | - return static::$application; |
|
52 | - } |
|
41 | + /** |
|
42 | + * @return Application |
|
43 | + */ |
|
44 | + public function getApplication() |
|
45 | + { |
|
46 | + if(!is_object(static::$application)){ |
|
47 | + $configFile = realpath(__DIR__.'/../../../config/config.php'); |
|
48 | + $config = include($configFile); |
|
49 | + static::$application = Application::init($config); |
|
50 | + } |
|
51 | + return static::$application; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return \Zend\ServiceManager\ServiceManager |
|
56 | - */ |
|
57 | - public function getServiceManager() |
|
58 | - { |
|
59 | - return $this->getApplication()->getServiceManager(); |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return \Zend\ServiceManager\ServiceManager |
|
56 | + */ |
|
57 | + public function getServiceManager() |
|
58 | + { |
|
59 | + return $this->getApplication()->getServiceManager(); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @return \Zend\EventManager\EventManagerInterface |
|
64 | - */ |
|
65 | - public function getEventManager() |
|
66 | - { |
|
67 | - return $this->getApplication()->getEventManager(); |
|
68 | - } |
|
62 | + /** |
|
63 | + * @return \Zend\EventManager\EventManagerInterface |
|
64 | + */ |
|
65 | + public function getEventManager() |
|
66 | + { |
|
67 | + return $this->getApplication()->getEventManager(); |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return RepositoryService |
|
72 | - */ |
|
73 | - public function getRepositories() |
|
74 | - { |
|
75 | - return $this->getServiceManager()->get('repositories'); |
|
76 | - } |
|
70 | + /** |
|
71 | + * @return RepositoryService |
|
72 | + */ |
|
73 | + public function getRepositories() |
|
74 | + { |
|
75 | + return $this->getServiceManager()->get('repositories'); |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * @param $name |
|
80 | - * @param array $params |
|
81 | - * |
|
82 | - * @return string |
|
83 | - */ |
|
84 | - public function generateUrl($name) |
|
85 | - { |
|
86 | - return $this->minkContext->locatePath($name); |
|
87 | - } |
|
78 | + /** |
|
79 | + * @param $name |
|
80 | + * @param array $params |
|
81 | + * |
|
82 | + * @return string |
|
83 | + */ |
|
84 | + public function generateUrl($name) |
|
85 | + { |
|
86 | + return $this->minkContext->locatePath($name); |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * @When /^I hover over the element "([^"]*)"$/ |
|
91 | - */ |
|
92 | - public function iHoverOverTheElement($locator) |
|
93 | - { |
|
94 | - $session = $this->minkContext->getSession(); // get the mink session |
|
95 | - $element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element |
|
89 | + /** |
|
90 | + * @When /^I hover over the element "([^"]*)"$/ |
|
91 | + */ |
|
92 | + public function iHoverOverTheElement($locator) |
|
93 | + { |
|
94 | + $session = $this->minkContext->getSession(); // get the mink session |
|
95 | + $element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element |
|
96 | 96 | |
97 | - // errors must not pass silently |
|
98 | - if (null === $element) { |
|
99 | - throw new \InvalidArgumentException(sprintf('Could not evaluate CSS selector: "%s"', $locator)); |
|
100 | - } |
|
97 | + // errors must not pass silently |
|
98 | + if (null === $element) { |
|
99 | + throw new \InvalidArgumentException(sprintf('Could not evaluate CSS selector: "%s"', $locator)); |
|
100 | + } |
|
101 | 101 | |
102 | - // ok, let's hover it |
|
103 | - $element->mouseOver(); |
|
104 | - } |
|
102 | + // ok, let's hover it |
|
103 | + $element->mouseOver(); |
|
104 | + } |
|
105 | 105 | |
106 | - /** |
|
107 | - * @Given /^I wait for (\d+) seconds$/ |
|
108 | - */ |
|
109 | - public function iWaitForSecond($second) |
|
110 | - { |
|
111 | - sleep($second); |
|
112 | - } |
|
106 | + /** |
|
107 | + * @Given /^I wait for (\d+) seconds$/ |
|
108 | + */ |
|
109 | + public function iWaitForSecond($second) |
|
110 | + { |
|
111 | + sleep($second); |
|
112 | + } |
|
113 | 113 | |
114 | - /** |
|
115 | - * @Then /^I wait for the ajax response$/ |
|
116 | - */ |
|
117 | - public function iWaitForTheAjaxResponse() |
|
118 | - { |
|
119 | - $this->getSession()->wait(5000, '(0 === jQuery.active)'); |
|
120 | - } |
|
114 | + /** |
|
115 | + * @Then /^I wait for the ajax response$/ |
|
116 | + */ |
|
117 | + public function iWaitForTheAjaxResponse() |
|
118 | + { |
|
119 | + $this->getSession()->wait(5000, '(0 === jQuery.active)'); |
|
120 | + } |
|
121 | 121 | |
122 | - /** |
|
123 | - * Some forms do not have a Submit button just pass the ID |
|
124 | - * |
|
125 | - * @Given /^I submit the form with id "([^"]*)"$/ |
|
126 | - */ |
|
127 | - public function iSubmitTheFormWithId($arg) |
|
128 | - { |
|
129 | - $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
|
130 | - if($node) { |
|
131 | - $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
|
132 | - } else { |
|
133 | - throw new \Exception('Element not found'); |
|
134 | - } |
|
135 | - } |
|
122 | + /** |
|
123 | + * Some forms do not have a Submit button just pass the ID |
|
124 | + * |
|
125 | + * @Given /^I submit the form with id "([^"]*)"$/ |
|
126 | + */ |
|
127 | + public function iSubmitTheFormWithId($arg) |
|
128 | + { |
|
129 | + $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
|
130 | + if($node) { |
|
131 | + $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
|
132 | + } else { |
|
133 | + throw new \Exception('Element not found'); |
|
134 | + } |
|
135 | + } |
|
136 | 136 | |
137 | - /** |
|
138 | - * @Then I switch to popup :name |
|
139 | - * |
|
140 | - * @param $name |
|
141 | - */ |
|
142 | - public function iSwitchToPopup($name) |
|
143 | - { |
|
144 | - $this->iSetMainWindowName(); |
|
145 | - $this->getSession()->switchToWindow($name); |
|
146 | - } |
|
137 | + /** |
|
138 | + * @Then I switch to popup :name |
|
139 | + * |
|
140 | + * @param $name |
|
141 | + */ |
|
142 | + public function iSwitchToPopup($name) |
|
143 | + { |
|
144 | + $this->iSetMainWindowName(); |
|
145 | + $this->getSession()->switchToWindow($name); |
|
146 | + } |
|
147 | 147 | |
148 | - /** |
|
149 | - * @Then I set main window name |
|
150 | - */ |
|
151 | - public function iSetMainWindowName() |
|
152 | - { |
|
153 | - $window_name = 'main_window'; |
|
154 | - $script = 'window.name = "' . $window_name . '"'; |
|
155 | - $this->getSession()->executeScript($script); |
|
156 | - } |
|
148 | + /** |
|
149 | + * @Then I set main window name |
|
150 | + */ |
|
151 | + public function iSetMainWindowName() |
|
152 | + { |
|
153 | + $window_name = 'main_window'; |
|
154 | + $script = 'window.name = "' . $window_name . '"'; |
|
155 | + $this->getSession()->executeScript($script); |
|
156 | + } |
|
157 | 157 | |
158 | - /** |
|
159 | - * @Then I switch back to main window |
|
160 | - */ |
|
161 | - public function iSwitchBackToMainWindow() |
|
162 | - { |
|
163 | - $this->getSession()->switchToWindow('main_window'); |
|
164 | - } |
|
158 | + /** |
|
159 | + * @Then I switch back to main window |
|
160 | + */ |
|
161 | + public function iSwitchBackToMainWindow() |
|
162 | + { |
|
163 | + $this->getSession()->switchToWindow('main_window'); |
|
164 | + } |
|
165 | 165 | |
166 | - public function iVisit($url) |
|
167 | - { |
|
168 | - $this->minkContext->getSession()->visit($url); |
|
169 | - } |
|
166 | + public function iVisit($url) |
|
167 | + { |
|
168 | + $this->minkContext->getSession()->visit($url); |
|
169 | + } |
|
170 | 170 | |
171 | - /** |
|
172 | - * @When I scroll :selector into view |
|
173 | - * |
|
174 | - * @param string $selector Allowed selectors: #id, .className, //xpath |
|
175 | - * |
|
176 | - * @throws \Exception |
|
177 | - */ |
|
178 | - public function scrollIntoView($selector) |
|
179 | - { |
|
180 | - $locator = substr($selector, 0, 1); |
|
171 | + /** |
|
172 | + * @When I scroll :selector into view |
|
173 | + * |
|
174 | + * @param string $selector Allowed selectors: #id, .className, //xpath |
|
175 | + * |
|
176 | + * @throws \Exception |
|
177 | + */ |
|
178 | + public function scrollIntoView($selector) |
|
179 | + { |
|
180 | + $locator = substr($selector, 0, 1); |
|
181 | 181 | |
182 | - switch ($locator) { |
|
183 | - case '/' : // XPath selector |
|
184 | - $function = <<<JS |
|
182 | + switch ($locator) { |
|
183 | + case '/' : // XPath selector |
|
184 | + $function = <<<JS |
|
185 | 185 | (function(){ |
186 | 186 | var elem = document.evaluate($selector, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; |
187 | 187 | elem.scrollIntoView(false); |
188 | 188 | })() |
189 | 189 | JS; |
190 | - break; |
|
190 | + break; |
|
191 | 191 | |
192 | - case '#' : // ID selector |
|
193 | - $selector = substr($selector, 1); |
|
194 | - $function = <<<JS |
|
192 | + case '#' : // ID selector |
|
193 | + $selector = substr($selector, 1); |
|
194 | + $function = <<<JS |
|
195 | 195 | (function(){ |
196 | 196 | var elem = document.getElementById("$selector"); |
197 | 197 | elem.scrollIntoView(false); |
198 | 198 | })() |
199 | 199 | JS; |
200 | - break; |
|
200 | + break; |
|
201 | 201 | |
202 | - case '.' : // Class selector |
|
203 | - $selector = substr($selector, 1); |
|
204 | - $function = <<<JS |
|
202 | + case '.' : // Class selector |
|
203 | + $selector = substr($selector, 1); |
|
204 | + $function = <<<JS |
|
205 | 205 | (function(){ |
206 | 206 | var elem = document.getElementsByClassName("$selector"); |
207 | 207 | elem[0].scrollIntoView(false); |
208 | 208 | })() |
209 | 209 | JS; |
210 | - break; |
|
210 | + break; |
|
211 | 211 | |
212 | - default: |
|
213 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
214 | - break; |
|
215 | - } |
|
212 | + default: |
|
213 | + throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
214 | + break; |
|
215 | + } |
|
216 | 216 | |
217 | - try { |
|
218 | - $this->getSession()->executeScript($function); |
|
219 | - } catch (\Exception $e) { |
|
220 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
221 | - } |
|
222 | - } |
|
217 | + try { |
|
218 | + $this->getSession()->executeScript($function); |
|
219 | + } catch (\Exception $e) { |
|
220 | + throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
221 | + } |
|
222 | + } |
|
223 | 223 | |
224 | 224 | |
225 | - /** |
|
226 | - * @When I click location selector |
|
227 | - */ |
|
228 | - public function iClickLocationSelector() |
|
229 | - { |
|
230 | - $locator = '#jobBase-geoLocation-span .select2'; |
|
231 | - $element = $this->getElement($locator); |
|
232 | - $element->click(); |
|
233 | - } |
|
225 | + /** |
|
226 | + * @When I click location selector |
|
227 | + */ |
|
228 | + public function iClickLocationSelector() |
|
229 | + { |
|
230 | + $locator = '#jobBase-geoLocation-span .select2'; |
|
231 | + $element = $this->getElement($locator); |
|
232 | + $element->click(); |
|
233 | + } |
|
234 | 234 | |
235 | - /** |
|
236 | - * @param $locator |
|
237 | - * @param string $selector |
|
238 | - * |
|
239 | - * @return \Behat\Mink\Element\NodeElement|mixed|null |
|
240 | - */ |
|
241 | - public function getElement($locator,$selector='css') |
|
242 | - { |
|
243 | - $page = $this->minkContext->getSession()->getPage(); |
|
244 | - $element = $page->find('css',$locator); |
|
245 | - return $element; |
|
246 | - } |
|
235 | + /** |
|
236 | + * @param $locator |
|
237 | + * @param string $selector |
|
238 | + * |
|
239 | + * @return \Behat\Mink\Element\NodeElement|mixed|null |
|
240 | + */ |
|
241 | + public function getElement($locator,$selector='css') |
|
242 | + { |
|
243 | + $page = $this->minkContext->getSession()->getPage(); |
|
244 | + $element = $page->find('css',$locator); |
|
245 | + return $element; |
|
246 | + } |
|
247 | 247 | |
248 | - /** |
|
249 | - * @When I fill in location search with :term |
|
250 | - * @param $term |
|
251 | - */ |
|
252 | - public function iFillInLocationSearch($term) |
|
253 | - { |
|
254 | - $locator = '.select2-container--open .select2-search__field'; |
|
255 | - $element = $this->getElement($locator); |
|
256 | - $element->focus(); |
|
257 | - $element->setValue($term); |
|
258 | - $this->iWaitForTheAjaxResponse(); |
|
259 | - } |
|
248 | + /** |
|
249 | + * @When I fill in location search with :term |
|
250 | + * @param $term |
|
251 | + */ |
|
252 | + public function iFillInLocationSearch($term) |
|
253 | + { |
|
254 | + $locator = '.select2-container--open .select2-search__field'; |
|
255 | + $element = $this->getElement($locator); |
|
256 | + $element->focus(); |
|
257 | + $element->setValue($term); |
|
258 | + $this->iWaitForTheAjaxResponse(); |
|
259 | + } |
|
260 | 260 | |
261 | - public function iClickOn() |
|
262 | - { |
|
261 | + public function iClickOn() |
|
262 | + { |
|
263 | 263 | |
264 | - } |
|
264 | + } |
|
265 | 265 | } |
266 | 266 | \ No newline at end of file |
@@ -15,78 +15,78 @@ |
||
15 | 15 | |
16 | 16 | class SummaryFormContext implements Context |
17 | 17 | { |
18 | - use CommonContextTrait; |
|
18 | + use CommonContextTrait; |
|
19 | 19 | |
20 | - private $elementMap = array( |
|
21 | - 'name' => '#sf-nameForm', |
|
22 | - 'location' => '#sf-locationForm', |
|
23 | - 'employees' => '#sf-employeesManagement', |
|
24 | - 'workflow' => '#sf-workflowSettings', |
|
25 | - 'jobTitleAndLocation' => '#general-locationForm', |
|
26 | - 'jobClassification' => '#sf-general-classifications', |
|
27 | - 'customerNote' => '#sf-general-customerNote', |
|
28 | - 'personalInformations' => '#sf-contact-contact', |
|
29 | - 'resumePersonalInformations' => '#sf-contact', |
|
30 | - ); |
|
20 | + private $elementMap = array( |
|
21 | + 'name' => '#sf-nameForm', |
|
22 | + 'location' => '#sf-locationForm', |
|
23 | + 'employees' => '#sf-employeesManagement', |
|
24 | + 'workflow' => '#sf-workflowSettings', |
|
25 | + 'jobTitleAndLocation' => '#general-locationForm', |
|
26 | + 'jobClassification' => '#sf-general-classifications', |
|
27 | + 'customerNote' => '#sf-general-customerNote', |
|
28 | + 'personalInformations' => '#sf-contact-contact', |
|
29 | + 'resumePersonalInformations' => '#sf-contact', |
|
30 | + ); |
|
31 | 31 | |
32 | - /** |
|
33 | - * @When I click edit on :name form |
|
34 | - * @TODO: [ZF3] move this method to CoreContext |
|
35 | - */ |
|
36 | - public function iClickEditOnForm($name) |
|
37 | - { |
|
38 | - $this->iClickForm($name); |
|
39 | - $name = Inflector::camelize($name); |
|
40 | - $type = $this->elementMap[$name]; |
|
41 | - $locator = $type.' .sf-summary .sf-controls button'; |
|
42 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
43 | - if(!$element){ |
|
44 | - throw new \Exception('No element found with this locator: "'.$locator.'"'); |
|
45 | - } |
|
46 | - $element->click(); |
|
47 | - } |
|
32 | + /** |
|
33 | + * @When I click edit on :name form |
|
34 | + * @TODO: [ZF3] move this method to CoreContext |
|
35 | + */ |
|
36 | + public function iClickEditOnForm($name) |
|
37 | + { |
|
38 | + $this->iClickForm($name); |
|
39 | + $name = Inflector::camelize($name); |
|
40 | + $type = $this->elementMap[$name]; |
|
41 | + $locator = $type.' .sf-summary .sf-controls button'; |
|
42 | + $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
43 | + if(!$element){ |
|
44 | + throw new \Exception('No element found with this locator: "'.$locator.'"'); |
|
45 | + } |
|
46 | + $element->click(); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @When I click :form form |
|
51 | - */ |
|
52 | - public function iClickForm($name) |
|
53 | - { |
|
54 | - $name = Inflector::camelize($name); |
|
55 | - $type = $this->elementMap[$name]; |
|
56 | - $locator = $type.' .sf-summary'; |
|
57 | - $session = $this->minkContext->getSession(); |
|
58 | - $script = <<<EOC |
|
49 | + /** |
|
50 | + * @When I click :form form |
|
51 | + */ |
|
52 | + public function iClickForm($name) |
|
53 | + { |
|
54 | + $name = Inflector::camelize($name); |
|
55 | + $type = $this->elementMap[$name]; |
|
56 | + $locator = $type.' .sf-summary'; |
|
57 | + $session = $this->minkContext->getSession(); |
|
58 | + $script = <<<EOC |
|
59 | 59 | var tElement = jQuery("$locator .sf-controls"); |
60 | 60 | tElement.css('display','block'); |
61 | 61 | tElement.css('visibility','visible'); |
62 | 62 | EOC; |
63 | - $session->executeScript($script); |
|
64 | - } |
|
63 | + $session->executeScript($script); |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * @When I save :type form |
|
68 | - */ |
|
69 | - public function iSaveForm($type) |
|
70 | - { |
|
71 | - $type = Inflector::camelize($type); |
|
72 | - $method = 'iSave'.$type; |
|
73 | - if(method_exists($this,$method)){ |
|
74 | - call_user_func([$this,$method]); |
|
75 | - }else{ |
|
76 | - $locator = $this->elementMap[$type].'-buttons-submit'; |
|
77 | - $this->coreContext->scrollIntoView($locator); |
|
78 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
79 | - $element->click(); |
|
80 | - } |
|
81 | - } |
|
66 | + /** |
|
67 | + * @When I save :type form |
|
68 | + */ |
|
69 | + public function iSaveForm($type) |
|
70 | + { |
|
71 | + $type = Inflector::camelize($type); |
|
72 | + $method = 'iSave'.$type; |
|
73 | + if(method_exists($this,$method)){ |
|
74 | + call_user_func([$this,$method]); |
|
75 | + }else{ |
|
76 | + $locator = $this->elementMap[$type].'-buttons-submit'; |
|
77 | + $this->coreContext->scrollIntoView($locator); |
|
78 | + $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
79 | + $element->click(); |
|
80 | + } |
|
81 | + } |
|
82 | 82 | |
83 | - public function iSaveJobClassification() |
|
84 | - { |
|
85 | - $locator = '#general-classifications-buttons-submit'; |
|
86 | - $this->coreContext->scrollIntoView($locator); |
|
87 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
88 | - $element->click(); |
|
89 | - } |
|
83 | + public function iSaveJobClassification() |
|
84 | + { |
|
85 | + $locator = '#general-classifications-buttons-submit'; |
|
86 | + $this->coreContext->scrollIntoView($locator); |
|
87 | + $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
88 | + $element->click(); |
|
89 | + } |
|
90 | 90 | |
91 | 91 | |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -138,14 +138,14 @@ |
||
138 | 138 | if (!$this->test($resource, $privilege)) { |
139 | 139 | $msg = null === $privilege |
140 | 140 | ? sprintf( |
141 | - 'You are not allowed to access resource "%s"', |
|
142 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
143 | - ) |
|
141 | + 'You are not allowed to access resource "%s"', |
|
142 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
143 | + ) |
|
144 | 144 | : sprintf( |
145 | - 'You are not allowed to execute operation "%s" on resource "%s"', |
|
146 | - $privilege, |
|
147 | - is_object($resource) ? $resource->getResourceId() : $resource |
|
148 | - ); |
|
145 | + 'You are not allowed to execute operation "%s" on resource "%s"', |
|
146 | + $privilege, |
|
147 | + is_object($resource) ? $resource->getResourceId() : $resource |
|
148 | + ); |
|
149 | 149 | |
150 | 150 | if ($resource instanceof FileInterface && 0 == strpos($resource->getType(), 'image/')) { |
151 | 151 | throw new UnauthorizedImageAccessException(str_replace('resource', 'image', $msg)); |
@@ -274,9 +274,9 @@ discard block |
||
274 | 274 | ], |
275 | 275 | 'factories' => [ |
276 | 276 | 'Jobs/Import' => [ Controller\ImportController::class, 'factory'], |
277 | - 'Jobs/Console' => [ConsoleController::class,'factory'], |
|
278 | - 'Jobs/AdminCategories' => [AdminCategoriesController::class,'factory'], |
|
279 | - 'Jobs/Admin' => [AdminController::class,'factory'], |
|
277 | + 'Jobs/Console' => [ConsoleController::class,'factory'], |
|
278 | + 'Jobs/AdminCategories' => [AdminCategoriesController::class,'factory'], |
|
279 | + 'Jobs/Admin' => [AdminController::class,'factory'], |
|
280 | 280 | 'Jobs/Template' => 'Jobs\Factory\Controller\TemplateControllerFactory', |
281 | 281 | 'Jobs/Index' => 'Jobs\Factory\Controller\IndexControllerFactory', |
282 | 282 | 'Jobs/Approval' => 'Jobs\Factory\Controller\ApprovalControllerFactory', |
@@ -428,15 +428,15 @@ discard block |
||
428 | 428 | 'invokables' => [ |
429 | 429 | 'Jobs/Location/New' => 'Jobs\Form\InputFilter\JobLocationNew', |
430 | 430 | //'Jobs/Location/Edit' => 'Jobs\Form\InputFilter\JobLocationEdit', |
431 | - JobLocationEdit::class => JobLocationEdit::class, |
|
431 | + JobLocationEdit::class => JobLocationEdit::class, |
|
432 | 432 | 'Jobs/Company' => 'Jobs\Form\InputFilter\CompanyName', |
433 | 433 | ], |
434 | 434 | 'factories' => [ |
435 | 435 | 'Jobs/AtsMode' => 'Jobs\Factory\Form\InputFilter\AtsModeFactory', |
436 | 436 | ], |
437 | - 'aliases' => [ |
|
438 | - 'Jobs/Location/Edit' => JobLocationEdit::class |
|
439 | - ] |
|
437 | + 'aliases' => [ |
|
438 | + 'Jobs/Location/Edit' => JobLocationEdit::class |
|
439 | + ] |
|
440 | 440 | ], |
441 | 441 | |
442 | 442 | 'filters' => [ |
@@ -191,9 +191,9 @@ |
||
191 | 191 | $location = new Location(); |
192 | 192 | $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']); |
193 | 193 | $location->setCountry($locData['country']) |
194 | - ->setRegion($locData['region']) |
|
195 | - ->setCity($locData['city']) |
|
196 | - ->setCoordinates(new Point($coords)); |
|
194 | + ->setRegion($locData['region']) |
|
195 | + ->setCity($locData['city']) |
|
196 | + ->setCoordinates(new Point($coords)); |
|
197 | 197 | |
198 | 198 | $jobLocations->add($location); |
199 | 199 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | $content = $this->renderElements($form, $colMap, $buttonsSpan); |
68 | 68 | |
69 | 69 | return $this->openTag($form) |
70 | - . '<div class="row" style="padding: 0 15px;">' |
|
71 | - . $content . '</div>' . $this->closeTag(); |
|
70 | + . '<div class="row" style="padding: 0 15px;">' |
|
71 | + . $content . '</div>' . $this->closeTag(); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | $attrs = $helper->createAttributesString($button->getAttributes()); |
83 | 83 | |
84 | 84 | $content.= '<button ' . $attrs . '>' |
85 | - . $this->getTranslator()->translate($button->getLabel(), $this->getTranslatorTextDomain()) |
|
86 | - . '</button>'; |
|
85 | + . $this->getTranslator()->translate($button->getLabel(), $this->getTranslatorTextDomain()) |
|
86 | + . '</button>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | return $content; |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | |
121 | 121 | if ($element->getName() == $form->getButtonElement()) { |
122 | 122 | $content.='<div class="input-group col-md-' . $cols . '">' |
123 | - . $formElement($element) |
|
124 | - . '<div class="input-group-btn search-form-buttons" style="width: 1px;">' |
|
125 | - . $this->renderButtons($form->getButtons()) . '</div>' |
|
126 | - . '</div>'; |
|
123 | + . $formElement($element) |
|
124 | + . '<div class="input-group-btn search-form-buttons" style="width: 1px;">' |
|
125 | + . $this->renderButtons($form->getButtons()) . '</div>' |
|
126 | + . '</div>'; |
|
127 | 127 | $buttonsRendered = true; |
128 | 128 | } else { |
129 | 129 | $content .= '<div class="input-group col-md-' . $cols . '">' |
130 | - . $formElement($element) |
|
131 | - . '</div>'; |
|
130 | + . $formElement($element) |
|
131 | + . '</div>'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $i += 1; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $buttonsSpan = $form->getOption('buttons_span') ?: 12; |
140 | 140 | } |
141 | 141 | $content .= '<div class="input-group search-form-buttons col-md-' . $buttonsSpan . ' text-right">' |
142 | - . '<div class="btn-group">' . $this->renderButtons($form->getButtons()) .'</div></div>'; |
|
142 | + . '<div class="btn-group">' . $this->renderButtons($form->getButtons()) .'</div></div>'; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $content; |
@@ -62,16 +62,16 @@ |
||
62 | 62 | $services = $application->getServiceManager(); |
63 | 63 | |
64 | 64 | $services->get('Install/Listener/LanguageSetter') |
65 | - ->attach($eventManager); |
|
65 | + ->attach($eventManager); |
|
66 | 66 | |
67 | - $tracyConfig = $services->get('Config')['tracy']; |
|
67 | + $tracyConfig = $services->get('Config')['tracy']; |
|
68 | 68 | |
69 | - if ($tracyConfig['enabled']) { |
|
70 | - (new TracyService())->register($tracyConfig); |
|
71 | - (new TracyListener())->attach($eventManager); |
|
72 | - } |
|
69 | + if ($tracyConfig['enabled']) { |
|
70 | + (new TracyService())->register($tracyConfig); |
|
71 | + (new TracyListener())->attach($eventManager); |
|
72 | + } |
|
73 | 73 | |
74 | - // Clear the user identity, if any. (#370) |
|
74 | + // Clear the user identity, if any. (#370) |
|
75 | 75 | $services->get('AuthenticationService')->clearIdentity(); |
76 | 76 | } |
77 | 77 | } |
@@ -39,24 +39,24 @@ discard block |
||
39 | 39 | 'log' => array( |
40 | 40 | 'Core/Log' => array( |
41 | 41 | 'writers' => array( |
42 | - array( |
|
43 | - 'name' => 'stream', |
|
42 | + array( |
|
43 | + 'name' => 'stream', |
|
44 | 44 | 'priority' => 1000, |
45 | 45 | 'options' => array( |
46 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
46 | + 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
47 | + ), |
|
47 | 48 | ), |
48 | - ), |
|
49 | 49 | ), |
50 | 50 | ), |
51 | 51 | 'Log/Core/Mail' => array( |
52 | 52 | 'writers' => array( |
53 | - array( |
|
54 | - 'name' => 'stream', |
|
53 | + array( |
|
54 | + 'name' => 'stream', |
|
55 | 55 | 'priority' => 1000, |
56 | 56 | 'options' => array( |
57 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
57 | + 'stream' => __DIR__ .'/../../../log/mails.log', |
|
58 | + ), |
|
58 | 59 | ), |
59 | - ), |
|
60 | 60 | ), |
61 | 61 | ), |
62 | 62 | ), |
@@ -248,17 +248,17 @@ discard block |
||
248 | 248 | // Defines the Core/Navigation. |
249 | 249 | 'navigation' => array( |
250 | 250 | 'default' => array( |
251 | - 'home' => array( |
|
252 | - 'label' => /*@translate*/ 'Home', |
|
253 | - 'route' => 'lang', |
|
254 | - 'visible' => false |
|
255 | - ), |
|
256 | - 'admin' => array( |
|
257 | - 'label ' => /*@translate*/ 'Admin', |
|
258 | - 'route' => 'lang/admin', |
|
259 | - 'resource' => 'route/lang/admin', |
|
260 | - 'order' => 200, |
|
261 | - ), |
|
251 | + 'home' => array( |
|
252 | + 'label' => /*@translate*/ 'Home', |
|
253 | + 'route' => 'lang', |
|
254 | + 'visible' => false |
|
255 | + ), |
|
256 | + 'admin' => array( |
|
257 | + 'label ' => /*@translate*/ 'Admin', |
|
258 | + 'route' => 'lang/admin', |
|
259 | + 'resource' => 'route/lang/admin', |
|
260 | + 'order' => 200, |
|
261 | + ), |
|
262 | 262 | ), |
263 | 263 | ), |
264 | 264 | // Configuration of the controller service manager (Which loads controllers) |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | 'invokables' => array( |
267 | 267 | 'Core\Controller\Content' => 'Core\Controller\ContentController', |
268 | 268 | ), |
269 | - 'factories' => [ |
|
270 | - // @TODO: improve this factory |
|
271 | - 'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'], |
|
272 | - 'Core/Admin' => [\Core\Controller\AdminController::class,'factory'], |
|
273 | - 'Core\Controller\File' => [\Core\Controller\FileController::class,'factory'], |
|
274 | - ], |
|
269 | + 'factories' => [ |
|
270 | + // @TODO: improve this factory |
|
271 | + 'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'], |
|
272 | + 'Core/Admin' => [\Core\Controller\AdminController::class,'factory'], |
|
273 | + 'Core\Controller\File' => [\Core\Controller\FileController::class,'factory'], |
|
274 | + ], |
|
275 | 275 | 'abstract_factories' => [ |
276 | - \Core\Factory\Controller\LazyControllerFactory::class |
|
276 | + \Core\Factory\Controller\LazyControllerFactory::class |
|
277 | 277 | ], |
278 | 278 | ), |
279 | 279 | // Configuration of the controller plugin service manager |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | 'paginatorservice' => 'Core/PaginatorService', |
305 | 305 | 'paginationParams' => 'Core/PaginationParams', |
306 | 306 | 'searchform' => 'Core/SearchForm', |
307 | - 'notification' => 'Notification', |
|
307 | + 'notification' => 'Notification', |
|
308 | 308 | ) |
309 | 309 | ), |
310 | 310 | // Configure the view service manager |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | ), |
403 | 403 | 'aliases' => [ |
404 | 404 | 'snippet' => \Core\View\Helper\Snippet::class, |
405 | - 'ajaxUrl' => \Core\View\Helper\AjaxUrl::class, |
|
405 | + 'ajaxUrl' => \Core\View\Helper\AjaxUrl::class, |
|
406 | 406 | 'proxy' => \Core\View\Helper\Proxy::class, |
407 | 407 | 'form_element' => 'formElement', |
408 | 408 | ], |
@@ -500,17 +500,17 @@ discard block |
||
500 | 500 | ], |
501 | 501 | |
502 | 502 | 'Core/Ajax/Events' => [ |
503 | - 'service' => 'Core/EventManager', |
|
504 | - 'event' => \Core\Listener\Events\AjaxEvent::class, |
|
503 | + 'service' => 'Core/EventManager', |
|
504 | + 'event' => \Core\Listener\Events\AjaxEvent::class, |
|
505 | 505 | ], |
506 | 506 | |
507 | - 'Core/File/Events' => [ |
|
508 | - 'service' => 'Core/EventManager', |
|
509 | - 'event' => \Core\Listener\Events\FileEvent::class, |
|
507 | + 'Core/File/Events' => [ |
|
508 | + 'service' => 'Core/EventManager', |
|
509 | + 'event' => \Core\Listener\Events\FileEvent::class, |
|
510 | 510 | 'listeners' => [ |
511 | 511 | \Core\Listener\DeleteImageSetListener::class => [\Core\Listener\Events\FileEvent::EVENT_DELETE, -1000], |
512 | 512 | ], |
513 | - ] |
|
513 | + ] |
|
514 | 514 | ], |
515 | 515 | |
516 | 516 | ); |