@@ -54,8 +54,7 @@ |
||
54 | 54 | if (method_exists($events, 'setEventPrototype')) { |
55 | 55 | $event = $serviceLocator->has($config['event']) ? $serviceLocator->get($config['event']) : new $config['event'](); |
56 | 56 | $events->setEventPrototype($event); |
57 | - } |
|
58 | - else { |
|
57 | + } else { |
|
59 | 58 | $events->setEventClass($config['event']); |
60 | 59 | } |
61 | 60 |
@@ -293,7 +293,7 @@ |
||
293 | 293 | * @param string|array $options String is either event name or aggregate name (when name is int). |
294 | 294 | * Array are the options from config. [ [event,..], method, priority, lazy] |
295 | 295 | * |
296 | - * @return array |
|
296 | + * @return \Zend\EventManager\EventManagerInterface |
|
297 | 297 | */ |
298 | 298 | protected function normalizeListenerOptions($name, $options) |
299 | 299 | { |
@@ -278,7 +278,7 @@ |
||
278 | 278 | /* @var \Core\Listener\DeferredListenerAggregate $aggregate */ |
279 | 279 | $aggregate = $services->get('Core/Listener/DeferredListenerAggregate'); |
280 | 280 | $aggregate->setListeners($lazyListeners) |
281 | - ->attach($eventManager); |
|
281 | + ->attach($eventManager); |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $defaults = [ |
149 | 149 | 'service' => 'EventManager', |
150 | 150 | 'configure' => true, |
151 | - 'identifiers' => [ $name ], |
|
151 | + 'identifiers' => [$name], |
|
152 | 152 | 'event' => '\Zend\EventManager\Event', |
153 | 153 | 'listeners' => [], |
154 | 154 | ]; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | foreach ($listeners as $name => $options) { |
240 | 240 | $options = $this->normalizeListenerOptions($name, $options); |
241 | 241 | |
242 | - if ($options['lazy'] && null !== $options['attach'] ) { |
|
242 | + if ($options['lazy'] && null !== $options['attach']) { |
|
243 | 243 | foreach ($options['attach'] as $spec) { |
244 | 244 | $lazyListeners[] = [ |
245 | 245 | 'service' => $options['service'], |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | } |
270 | 270 | |
271 | 271 | foreach ($options['attach'] as $spec) { |
272 | - $callback = $spec['method'] ? [ $listener, $spec['method'] ] : $listener; |
|
272 | + $callback = $spec['method'] ? [$listener, $spec['method']] : $listener; |
|
273 | 273 | $eventManager->attach($spec['events'], $callback, $spec['priority']); |
274 | 274 | } |
275 | 275 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | if (is_string($options)) { |
342 | 342 | /* Only an event name is provided in config */ |
343 | - $normalized['attach'] = [ [ 'events' => [ $options ], 'method' => null, 'priority' => 0 ] ]; |
|
343 | + $normalized['attach'] = [['events' => [$options], 'method' => null, 'priority' => 0]]; |
|
344 | 344 | return $normalized; |
345 | 345 | |
346 | 346 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } else if (is_string($opt)) { |
370 | 370 | if (null === $event) { |
371 | 371 | /* first string found is assumed to be the event name */ |
372 | - $event = [ $opt ]; |
|
372 | + $event = [$opt]; |
|
373 | 373 | } else { |
374 | 374 | /* second string found must be a method name. */ |
375 | 375 | $method = $opt; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
388 | - $normalized['attach'] = [ [ 'events' => $event, 'method' => $method, 'priority' => $priority ] ]; |
|
388 | + $normalized['attach'] = [['events' => $event, 'method' => $method, 'priority' => $priority]]; |
|
389 | 389 | $normalized['lazy'] = $lazy; |
390 | 390 | |
391 | 391 | return $normalized; |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | protected function normalizeEventsSpec($options) |
395 | 395 | { |
396 | 396 | $listenerPriority = isset($options['priority']) ? $options['priority'] : 0; |
397 | - $listenerMethod = isset($options['method']) ? $options['method'] : '__none__'; |
|
397 | + $listenerMethod = isset($options['method']) ? $options['method'] : '__none__'; |
|
398 | 398 | $events = []; |
399 | 399 | |
400 | 400 | foreach ($options['events'] as $event => $spec) { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | } else if (is_array($spec)) { |
415 | 415 | if (isset($spec['method'])) { |
416 | 416 | if (!is_array($spec['method'])) { |
417 | - $spec['method'] = [ $spec['method'] ]; |
|
417 | + $spec['method'] = [$spec['method']]; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | foreach ($spec['method'] as $method => $methodPriority) { |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @license MIT |
7 | 7 | * @copyright 2013 - 2016 Cross Solution <http://cross-solution.de> |
8 | 8 | */ |
9 | -return [ 'router' => [ 'routes' => [ 'lang' => [ 'child_routes' => [ |
|
9 | +return ['router' => ['routes' => ['lang' => ['child_routes' => [ |
|
10 | 10 | |
11 | 11 | 'orders' => [ |
12 | 12 | 'type' => 'Segment', |
@@ -60,4 +60,4 @@ |
||
60 | 60 | ], |
61 | 61 | ], |
62 | 62 | ]; |
63 | - |
|
64 | 63 | \ No newline at end of file |
64 | + |
|
65 | 65 | \ No newline at end of file |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * for multiple paths. |
24 | 24 | * example https://github.com/doctrine/DoctrineORMModule |
25 | 25 | */ |
26 | - 'paths' => array( __DIR__ . '/../src/Entity'), |
|
26 | + 'paths' => array(__DIR__.'/../src/Entity'), |
|
27 | 27 | ), |
28 | 28 | ], |
29 | 29 | ], |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'translation_file_patterns' => array( |
34 | 34 | array( |
35 | 35 | 'type' => 'gettext', |
36 | - 'base_dir' => __DIR__ . '/../language', |
|
36 | + 'base_dir' => __DIR__.'/../language', |
|
37 | 37 | 'pattern' => '%s.mo', |
38 | 38 | ), |
39 | 39 | ), |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | 'event_manager' => [ |
44 | 44 | |
45 | - 'Jobs/Events' => [ 'listeners' => [ |
|
46 | - 'Orders/Listener/CreateJobOrder' => [ \Jobs\Listener\Events\JobEvent::EVENT_JOB_CREATED, true ], |
|
45 | + 'Jobs/Events' => ['listeners' => [ |
|
46 | + 'Orders/Listener/CreateJobOrder' => [\Jobs\Listener\Events\JobEvent::EVENT_JOB_CREATED, true], |
|
47 | 47 | ]], |
48 | 48 | |
49 | - 'Jobs/JobContainer/Events' => [ 'listeners' => [ |
|
49 | + 'Jobs/JobContainer/Events' => ['listeners' => [ |
|
50 | 50 | '\Orders\Form\Listener\DisableJobInvoiceAddress' => 'DisableElements', |
51 | 51 | 'Orders\Form\Listener\InjectInvoiceAddressInJobContainer' => \Core\Form\Event\FormEvent::EVENT_INIT, |
52 | 52 | '\Orders\Form\Listener\ValidateJobInvoiceAddress' => 'ValidateJob', |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ], |
60 | 60 | ], |
61 | 61 | |
62 | - 'Core/AdminController/Events' => [ 'listeners' => [ |
|
62 | + 'Core/AdminController/Events' => ['listeners' => [ |
|
63 | 63 | 'Orders/Listener/AdminWidgetProvider' => \Core\Controller\AdminControllerEvent::EVENT_DASHBOARD, |
64 | 64 | ]], |
65 | 65 | ], |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'view_helper_config' => [ |
83 | 83 | 'headscript' => [ |
84 | 84 | 'lang/orders' => [ |
85 | - [ \Zend\View\Helper\HeadScript::FILE, 'Orders/js/list.index.js', 'PREPEND' ], |
|
85 | + [\Zend\View\Helper\HeadScript::FILE, 'Orders/js/list.index.js', 'PREPEND'], |
|
86 | 86 | 'js/bootstrap-dialog.min.js' |
87 | 87 | ], |
88 | 88 | ], |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * @copyright 2013 - 2016 Cross Solution <http://cross-solution.de> |
8 | 8 | */ |
9 | 9 | |
10 | -return [ 'acl' => [ |
|
10 | +return ['acl' => [ |
|
11 | 11 | |
12 | 12 | 'rules' => [ |
13 | 13 | 'admin' => [ |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function setPrice($amount) |
238 | 238 | { |
239 | - $tax = $this->getTaxRate() / 100; |
|
239 | + $tax = $this->getTaxRate() / 100; |
|
240 | 240 | $taxAmount = $amount * $tax; |
241 | 241 | |
242 | 242 | $this->prices = [ |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | return $this; |
249 | 249 | } |
250 | 250 | |
251 | - public function getPrice($type="net") |
|
251 | + public function getPrice($type = "net") |
|
252 | 252 | { |
253 | 253 | if (!$this->prices || !array_key_exists($type, $this->prices)) { |
254 | 254 | return 0; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | * |
265 | 265 | * @return array |
266 | 266 | */ |
267 | - public function getPrices($calculate=false) |
|
267 | + public function getPrices($calculate = false) |
|
268 | 268 | { |
269 | 269 | /*if (!$this->prices || $calculate) { |
270 | 270 | $this->calculatePrices(); |
@@ -22,14 +22,14 @@ |
||
22 | 22 | */ |
23 | 23 | class Orders extends AbstractRepository |
24 | 24 | { |
25 | - public function createJobOrder(array $data=[]) |
|
25 | + public function createJobOrder(array $data = []) |
|
26 | 26 | { |
27 | 27 | $data['type'] = OrderInterface::TYPE_JOB; |
28 | 28 | |
29 | 29 | return $this->create($data); |
30 | 30 | } |
31 | 31 | |
32 | - public function create(array $data=[], $counterName = null, $counterFormat = null) |
|
32 | + public function create(array $data = [], $counterName = null, $counterFormat = null) |
|
33 | 33 | { |
34 | 34 | if (isset($data['counter'])) { |
35 | 35 | $counterName = $data['counter']; |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | $jobEntity = $this->initializeJob()->get($this->params()); |
140 | 140 | |
141 | 141 | $model = new ViewModel([ |
142 | - 'portals' => $jobEntity->getPortals(), |
|
143 | - 'channels' => $channels, |
|
144 | - 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
145 | - 'defaultTaxRate' => $options->defaultTaxRate, |
|
146 | - 'jobId' => $jobEntity->getId() |
|
147 | - ]); |
|
142 | + 'portals' => $jobEntity->getPortals(), |
|
143 | + 'channels' => $channels, |
|
144 | + 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
145 | + 'defaultTaxRate' => $options->defaultTaxRate, |
|
146 | + 'jobId' => $jobEntity->getId() |
|
147 | + ]); |
|
148 | 148 | $model->setTemplate('jobs/partials/channel-list')->setTerminal(true); |
149 | 149 | return $model; |
150 | 150 | } |
@@ -440,9 +440,9 @@ discard block |
||
440 | 440 | // we want just some Values to be compared |
441 | 441 | $diff = null; |
442 | 442 | foreach (array('title', 'organization', 'location', |
443 | - 'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title', |
|
444 | - 'templateValues._freeValues.description', |
|
445 | - ) as $prelKey) { |
|
443 | + 'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title', |
|
444 | + 'templateValues._freeValues.description', |
|
445 | + ) as $prelKey) { |
|
446 | 446 | if (array_key_exists($prelKey, $prelDiff)) { |
447 | 447 | $diff[$prelKey] = $prelDiff[$prelKey]; |
448 | 448 | } |
@@ -471,28 +471,28 @@ discard block |
||
471 | 471 | 'lang/jobs/view', |
472 | 472 | array(), |
473 | 473 | array('query' => |
474 | - array( 'id' => $jobEntity->getId())) |
|
474 | + array( 'id' => $jobEntity->getId())) |
|
475 | 475 | ); |
476 | 476 | |
477 | 477 | $approvalLink = $this->url()->fromRoute( |
478 | 478 | 'lang/jobs/approval', |
479 | 479 | array('state' => 'approved'), |
480 | 480 | array('query' => |
481 | - array( 'id' => $jobEntity->getId())) |
|
481 | + array( 'id' => $jobEntity->getId())) |
|
482 | 482 | ); |
483 | 483 | |
484 | 484 | $declineLink = $this->url()->fromRoute( |
485 | 485 | 'lang/jobs/approval', |
486 | 486 | array('state' => 'declined'), |
487 | 487 | array('query' => |
488 | - array( 'id' => $jobEntity->getId())) |
|
488 | + array( 'id' => $jobEntity->getId())) |
|
489 | 489 | ); |
490 | 490 | |
491 | 491 | return array('job' => $jobEntity, |
492 | - 'diffSnapshot' => $diff, |
|
493 | - 'viewLink' => $viewLink, |
|
494 | - 'approvalLink' => $approvalLink, |
|
495 | - 'declineLink' => $declineLink); |
|
492 | + 'diffSnapshot' => $diff, |
|
493 | + 'viewLink' => $viewLink, |
|
494 | + 'approvalLink' => $approvalLink, |
|
495 | + 'declineLink' => $declineLink); |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | if (empty($user->info->email)) { |
171 | 171 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
172 | 172 | } |
173 | - $userOrg = $user->getOrganization(); |
|
173 | + $userOrg = $user->getOrganization(); |
|
174 | 174 | if (!$userOrg->hasAssociation()) { |
175 | 175 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
176 | 176 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $instanceForm = null; |
193 | 193 | $formErrorMessages = array(); |
194 | 194 | |
195 | - if (isset($formIdentifier) && $request->isPost()) { |
|
195 | + if (isset($formIdentifier) && $request->isPost()) { |
|
196 | 196 | // at this point the form get instantiated and immediately accumulated |
197 | 197 | $instanceForm = $form->getForm($formIdentifier); |
198 | 198 | if (!isset($instanceForm)) { |
199 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
199 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
200 | 200 | } |
201 | 201 | // the id may be part of the postData, but it never should be altered |
202 | 202 | $postData = $request->getPost(); |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | $jobValid = false; |
251 | 251 | $errorMessage[] = $this->translator->translate('Accept the Terms'); |
252 | 252 | } |
253 | - $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]); |
|
253 | + $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]); |
|
254 | 254 | foreach ($result as $messages) { |
255 | 255 | if (!$messages) { |
256 | 256 | continue; |
257 | 257 | } |
258 | 258 | if (!is_array($messages)) { |
259 | - $messages = [ $messages ]; |
|
259 | + $messages = [$messages]; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $errorMessage = array_merge($errorMessage, $messages); |
263 | 263 | $jobValid = false; |
264 | 264 | } |
265 | 265 | |
266 | - $errorMessage = '<br />' . implode('<br />', $errorMessage); |
|
266 | + $errorMessage = '<br />'.implode('<br />', $errorMessage); |
|
267 | 267 | if ($isAjax) { |
268 | 268 | if ($instanceForm instanceof SummaryForm) { |
269 | 269 | $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } else { |
272 | 272 | $viewHelper = 'form'; |
273 | 273 | } |
274 | - $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
274 | + $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
275 | 275 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
276 | 276 | $viewModel = new JsonModel( |
277 | 277 | array( |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | } else { |
297 | - $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]); |
|
297 | + $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]); |
|
298 | 298 | // Job is deployed, some changes are now disabled |
299 | 299 | $form->enableAll(); |
300 | 300 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | $completionLink = $this->url()->fromRoute( |
304 | 304 | 'lang/jobs/completion', |
305 | - [ 'id' => $jobEntity->getId()] |
|
305 | + ['id' => $jobEntity->getId()] |
|
306 | 306 | ); |
307 | 307 | |
308 | 308 | $viewModel = $this->getViewModel($form); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | // array with differences between the last snapshot and the actual entity |
438 | 438 | // is remains Null if there is no snapshot |
439 | 439 | // it will be an empty array if the snapshot and the actual entity do not differ |
440 | - $diff = null; |
|
440 | + $diff = null; |
|
441 | 441 | // preliminary difference, contain all differences |
442 | 442 | $prelDiff = $this->entitySnapshot()->diff($jobEntity); |
443 | 443 | if (isset($prelDiff)) { |
@@ -475,21 +475,21 @@ discard block |
||
475 | 475 | 'lang/jobs/view', |
476 | 476 | array(), |
477 | 477 | array('query' => |
478 | - array( 'id' => $jobEntity->getId())) |
|
478 | + array('id' => $jobEntity->getId())) |
|
479 | 479 | ); |
480 | 480 | |
481 | 481 | $approvalLink = $this->url()->fromRoute( |
482 | 482 | 'lang/jobs/approval', |
483 | 483 | array('state' => 'approved'), |
484 | 484 | array('query' => |
485 | - array( 'id' => $jobEntity->getId())) |
|
485 | + array('id' => $jobEntity->getId())) |
|
486 | 486 | ); |
487 | 487 | |
488 | 488 | $declineLink = $this->url()->fromRoute( |
489 | 489 | 'lang/jobs/approval', |
490 | 490 | array('state' => 'declined'), |
491 | 491 | array('query' => |
492 | - array( 'id' => $jobEntity->getId())) |
|
492 | + array('id' => $jobEntity->getId())) |
|
493 | 493 | ); |
494 | 494 | |
495 | 495 | return array('job' => $jobEntity, |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | */ |
507 | 507 | public function deactivateAction() |
508 | 508 | { |
509 | - $user = $this->auth->getUser(); |
|
509 | + $user = $this->auth->getUser(); |
|
510 | 510 | |
511 | 511 | $jobEntity = $this->initializeJob()->get($this->params()); |
512 | 512 |
@@ -159,7 +159,6 @@ discard block |
||
159 | 159 | * |
160 | 160 | * parameter are arbitrary elements for defaults or programming flow |
161 | 161 | * |
162 | - * @param array $parameter |
|
163 | 162 | * @return null|ViewModel |
164 | 163 | * @throws \RuntimeException |
165 | 164 | */ |
@@ -366,7 +365,7 @@ discard block |
||
366 | 365 | |
367 | 366 | /** |
368 | 367 | * @param $job |
369 | - * @return mixed |
|
368 | + * @return \Jobs\Form\Job |
|
370 | 369 | */ |
371 | 370 | protected function getFormular($job) |
372 | 371 | { |
@@ -388,7 +387,7 @@ discard block |
||
388 | 387 | } |
389 | 388 | |
390 | 389 | /** |
391 | - * @param $form |
|
390 | + * @param \Jobs\Form\Job $form |
|
392 | 391 | * @param array $params |
393 | 392 | * @return ViewModel |
394 | 393 | */ |
@@ -564,7 +563,7 @@ discard block |
||
564 | 563 | } |
565 | 564 | |
566 | 565 | /** |
567 | - * @param $script |
|
566 | + * @param string $script |
|
568 | 567 | * @param array $parameter |
569 | 568 | * @return ViewModel |
570 | 569 | */ |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * |
17 | 17 | * @ODM\MappedSuperclass |
18 | - */ |
|
18 | + */ |
|
19 | 19 | abstract class AbstractIdentifiableEntity extends AbstractEntity implements IdentifiableEntityInterface |
20 | 20 | { |
21 | 21 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function trigger($event, $target = null) |
43 | 43 | { |
44 | 44 | if (empty($this->_template) || !is_string($this->_template)) { |
45 | - throw new \InvalidArgumentException('ContentCollector must have a template-name'); |
|
45 | + throw new \InvalidArgumentException('ContentCollector must have a template-name'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $responseCollection = $this->getController()->getEventManager()->trigger($event, $target); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | $viewModel->setTemplate($this->_template); |
51 | 51 | foreach ($responseCollection as $i => $response) { |
52 | 52 | if (is_string($response)) { |
53 | - $template = $response; |
|
54 | - $response = new ViewModel(array('target' => $target)); |
|
55 | - $response->setTemplate($template); |
|
53 | + $template = $response; |
|
54 | + $response = new ViewModel(array('target' => $target)); |
|
55 | + $response->setTemplate($template); |
|
56 | 56 | } |
57 | 57 | $viewModel->addChild($response, $this->_captureTo . $i); |
58 | 58 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $response = new ViewModel(array('target' => $target)); |
55 | 55 | $response->setTemplate($template); |
56 | 56 | } |
57 | - $viewModel->addChild($response, $this->_captureTo . $i); |
|
57 | + $viewModel->addChild($response, $this->_captureTo.$i); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | return $viewModel; |