@@ -37,8 +37,8 @@ |
||
37 | 37 | $headscript->appendFile($basepath('Settings/js/forms.decfs.js')); |
38 | 38 | |
39 | 39 | return '<ul class="disable-elements-list" id="' . $element->getAttribute('id') . '-list"' . '>' |
40 | - . $this->renderCheckboxes($element->getCheckboxes()) |
|
41 | - . '</ul>'; |
|
40 | + . $this->renderCheckboxes($element->getCheckboxes()) |
|
41 | + . '</ul>'; |
|
42 | 42 | |
43 | 43 | } |
44 | 44 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $headscript->appendFile($basepath('Settings/js/forms.decfs.js')); |
38 | 38 | |
39 | - return '<ul class="disable-elements-list" id="' . $element->getAttribute('id') . '-list"' . '>' |
|
39 | + return '<ul class="disable-elements-list" id="'.$element->getAttribute('id').'-list"'.'>' |
|
40 | 40 | . $this->renderCheckboxes($element->getCheckboxes()) |
41 | 41 | . '</ul>'; |
42 | 42 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | unset($boxes['__all__']); |
61 | 61 | } |
62 | 62 | |
63 | - $markup .= '<ul class="disable-elements">' . $this->renderCheckboxes($boxes) . '</ul>'; |
|
63 | + $markup .= '<ul class="disable-elements">'.$this->renderCheckboxes($boxes).'</ul>'; |
|
64 | 64 | } else { |
65 | 65 | $markup .= $this->renderCheckbox($boxes); |
66 | 66 | } |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
83 | 83 | $renderer = $this->getView(); |
84 | 84 | if (null !== $class) { |
85 | - $box->setAttribute('class', $box->getAttribute('class') . ' ' . $class); |
|
85 | + $box->setAttribute('class', $box->getAttribute('class').' '.$class); |
|
86 | 86 | } |
87 | 87 | $markup = $renderer->formCheckbox($box); |
88 | 88 | if ($desc = $box->getOption('description')) { |
89 | 89 | $desc = $this->getTranslator()->translate($desc, $this->getTranslatorTextDomain()); |
90 | - $markup .= '<div class="alert alert-info"><p>' . $desc . '</p></div>'; |
|
90 | + $markup .= '<div class="alert alert-info"><p>'.$desc.'</p></div>'; |
|
91 | 91 | } |
92 | 92 | return $markup; |
93 | 93 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $this->prepareCheckboxes($box, $prefix); |
196 | 196 | } else { |
197 | 197 | /* @var $box Checkbox */ |
198 | - $box->setName($prefix . $box->getName()); |
|
198 | + $box->setName($prefix.$box->getName()); |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | } |
@@ -232,10 +232,10 @@ discard block |
||
232 | 232 | foreach ($form as $element) { |
233 | 233 | /* @var $element \Zend\Form\ElementInterface|DisableElementsCapableInterface|DisableCapableInterface */ |
234 | 234 | $name = $element->getName(); |
235 | - $elementName = $prefix . '[' . $element->getName() . ']'; |
|
235 | + $elementName = $prefix.'['.$element->getName().']'; |
|
236 | 236 | $options = $element->getOption('disable_capable'); |
237 | 237 | $boxOptions = array( |
238 | - 'long_label' => isset($options['label']) ? $options['label'] : ($element->getLabel() ? : $name), |
|
238 | + 'long_label' => isset($options['label']) ? $options['label'] : ($element->getLabel() ?: $name), |
|
239 | 239 | 'description' => isset($options['description']) ? $options['description'] |
240 | 240 | : 'Toggle availability of this element in the form.', |
241 | 241 | ); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $return[$name] = $this->buildCheckboxes($element, $elementName); |
246 | 246 | } |
247 | 247 | if ($element->isDisableCapable()) { |
248 | - $box = $this->createCheckbox($elementName . '[__all__]', $boxOptions); |
|
248 | + $box = $this->createCheckbox($elementName.'[__all__]', $boxOptions); |
|
249 | 249 | $box->setAttribute('checked', true); |
250 | 250 | $return[$name]['__all__'] = $box; |
251 | 251 | } |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | |
14 | 14 | if (php_sapi_name() == 'cli-server') { |
15 | 15 | $route = parse_url(substr($_SERVER["REQUEST_URI"], 1))["path"]; |
16 | - if (is_file(__DIR__ . '/' . $route)) { |
|
17 | - if(substr($route, -4) == ".php"){ |
|
18 | - require __DIR__ . '/' . $route; // Include requested script files |
|
16 | + if (is_file(__DIR__.'/'.$route)) { |
|
17 | + if (substr($route, -4) == ".php") { |
|
18 | + require __DIR__.'/'.$route; // Include requested script files |
|
19 | 19 | exit; |
20 | 20 | } |
21 | - return false; // Serve file as is |
|
21 | + return false; // Serve file as is |
|
22 | 22 | } else { // Fallback to index.php |
23 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
23 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | } else { |
41 | 41 | echo '<p>Could not initialize autoloading. This happens, if the dependencies are not installed yet.</p>'; |
42 | 42 | echo '<p>Please try to install the dependencies via: </p>'; |
43 | - echo '<code>cd '. realpath('.') .'<br>./install.sh</code>'; |
|
44 | - echo '<p>exit at ' . __FILE__ . ' in line ' . __LINE__ .'</p>'; |
|
43 | + echo '<code>cd '.realpath('.').'<br>./install.sh</code>'; |
|
44 | + echo '<p>exit at '.__FILE__.' in line '.__LINE__.'</p>'; |
|
45 | 45 | exit; |
46 | 46 | } |
47 | 47 |
@@ -73,15 +73,15 @@ |
||
73 | 73 | if ('yawik' == $channelKey) { |
74 | 74 | $absoluteDiscount = 100; |
75 | 75 | } |
76 | - if ($channel instanceof ChannelOptions && $channel->getPrice('base')>0) { |
|
76 | + if ($channel instanceof ChannelOptions && $channel->getPrice('base') > 0) { |
|
77 | 77 | $sum += $channel->getPrice('base'); |
78 | 78 | $amount++; |
79 | 79 | } |
80 | 80 | } |
81 | - $discount=1-($amount-1)*13.5/100; |
|
82 | - if ($discount>0) { |
|
83 | - $sum= round($sum * $discount, 2); |
|
81 | + $discount = 1 - ($amount - 1) * 13.5 / 100; |
|
82 | + if ($discount > 0) { |
|
83 | + $sum = round($sum * $discount, 2); |
|
84 | 84 | } |
85 | - return $sum-$absoluteDiscount; |
|
85 | + return $sum - $absoluteDiscount; |
|
86 | 86 | } |
87 | 87 | } |
@@ -34,10 +34,10 @@ |
||
34 | 34 | */ |
35 | 35 | public function filter($value) |
36 | 36 | { |
37 | - if (!$value instanceof Job){ |
|
37 | + if (!$value instanceof Job) { |
|
38 | 38 | |
39 | 39 | } |
40 | - $reciptients=[]; |
|
40 | + $reciptients = []; |
|
41 | 41 | |
42 | 42 | return $reciptients; |
43 | 43 | } |
@@ -211,14 +211,14 @@ |
||
211 | 211 | { |
212 | 212 | return $this->repository; |
213 | 213 | } |
214 | - /** |
|
215 | - * @param SocialProfilePlugin |
|
216 | - * @return HybridAuth |
|
217 | - */ |
|
218 | - public function setSocialProfilePlugin(SocialProfilePlugin $socialProfilePlugin) |
|
219 | - { |
|
220 | - $this->socialProfilePlugin = $socialProfilePlugin; |
|
214 | + /** |
|
215 | + * @param SocialProfilePlugin |
|
216 | + * @return HybridAuth |
|
217 | + */ |
|
218 | + public function setSocialProfilePlugin(SocialProfilePlugin $socialProfilePlugin) |
|
219 | + { |
|
220 | + $this->socialProfilePlugin = $socialProfilePlugin; |
|
221 | 221 | |
222 | - return $this; |
|
223 | - } |
|
222 | + return $this; |
|
223 | + } |
|
224 | 224 | } |
@@ -61,14 +61,14 @@ |
||
61 | 61 | return $this->useDefaultValidation ? \Zend\Form\Form::isValid() : parent::isValid(); |
62 | 62 | } |
63 | 63 | |
64 | - /** |
|
65 | - * @param bool $bool |
|
66 | - * @return SocialProfiles |
|
67 | - */ |
|
68 | - public function setUseDefaultValidation($bool) |
|
69 | - { |
|
70 | - $this->useDefaultValidation = (bool)$bool; |
|
64 | + /** |
|
65 | + * @param bool $bool |
|
66 | + * @return SocialProfiles |
|
67 | + */ |
|
68 | + public function setUseDefaultValidation($bool) |
|
69 | + { |
|
70 | + $this->useDefaultValidation = (bool)$bool; |
|
71 | 71 | |
72 | - return $this; |
|
73 | - } |
|
72 | + return $this; |
|
73 | + } |
|
74 | 74 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | */ |
68 | 68 | public function setUseDefaultValidation($bool) |
69 | 69 | { |
70 | - $this->useDefaultValidation = (bool)$bool; |
|
70 | + $this->useDefaultValidation = (bool) $bool; |
|
71 | 71 | |
72 | 72 | return $this; |
73 | 73 | } |
@@ -96,8 +96,7 @@ |
||
96 | 96 | 'content' => $content, |
97 | 97 | ) |
98 | 98 | ); |
99 | - } |
|
100 | - elseif ($postProfiles) { |
|
99 | + } elseif ($postProfiles) { |
|
101 | 100 | $formSocialProfiles->setData($this->params()->fromPost()); |
102 | 101 | |
103 | 102 | if ($formSocialProfiles->isValid()) { |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | /* @var \Auth\Form\UserProfileContainer $container */ |
45 | 45 | $container = $forms->get('Auth/userprofilecontainer'); |
46 | 46 | $user = $serviceLocator->get('AuthenticationService')->getUser(); /* @var $user \Auth\Entity\User */ |
47 | - $postProfiles = (array)$this->params()->fromPost('social_profiles'); |
|
47 | + $postProfiles = (array) $this->params()->fromPost('social_profiles'); |
|
48 | 48 | $userProfiles = $user->getProfile(); |
49 | 49 | $formSocialProfiles = $forms->get('Auth/SocialProfiles') |
50 | 50 | ->setUseDefaultValidation(true) |
51 | - ->setData(['social_profiles' => array_map(function ($array) |
|
51 | + ->setData(['social_profiles' => array_map(function($array) |
|
52 | 52 | { |
53 | 53 | return $array['data']; |
54 | 54 | }, $userProfiles)]); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | )); |
132 | 132 | } else { |
133 | 133 | $profile = [ |
134 | - 'auth' => (array)$authProfile, |
|
134 | + 'auth' => (array) $authProfile, |
|
135 | 135 | 'data' => \Zend\Json\Json::decode($dataProfiles[$network]) |
136 | 136 | ]; |
137 | 137 | $user->addProfile($network, $profile); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | |
143 | 143 | // keep data in sync & properly decoded |
144 | - $formSocialProfiles->setData(['social_profiles' => array_map(function ($array) |
|
144 | + $formSocialProfiles->setData(['social_profiles' => array_map(function($array) |
|
145 | 145 | { |
146 | 146 | return \Zend\Json\Json::decode($array) ?: ''; |
147 | 147 | }, $dataProfiles)]); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | /** |
99 | 99 | * Gets an iterator to iterate over the enabled formulars. |
100 | 100 | * |
101 | - * @return \ArrayIterator |
|
101 | + * @return PriorityList |
|
102 | 102 | * @see IteratorAggregate::getIterator() |
103 | 103 | */ |
104 | 104 | public function getIterator() |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $formAction = $formInstance->getAttribute('action'); |
322 | 322 | |
323 | 323 | if (empty($formAction)) { |
324 | - $formInstance->setAttribute('action', '?form=' . $formName); |
|
324 | + $formInstance->setAttribute('action', '?form='.$formName); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | if (isset($form['label'])) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $spec->setParent($this); |
387 | 387 | } |
388 | 388 | |
389 | - $spec = [ '__instance__' => $spec, 'name' => $key, 'entity' => '*' ]; |
|
389 | + $spec = ['__instance__' => $spec, 'name' => $key, 'entity' => '*']; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | if (!is_array($spec)) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | } |
506 | 506 | $this->activeForms = array_filter( |
507 | 507 | $this->activeForms, |
508 | - function ($item) use ($key) { |
|
508 | + function($item) use ($key) { |
|
509 | 509 | return !in_array($item, $key); |
510 | 510 | } |
511 | 511 | ); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | * @throws \InvalidArgumentException |
520 | 520 | * @return Container |
521 | 521 | */ |
522 | - public function setEntity($entity, $key='*') |
|
522 | + public function setEntity($entity, $key = '*') |
|
523 | 523 | { |
524 | 524 | if (!$entity instanceof EntityInterface) |
525 | 525 | { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * |
543 | 543 | * @return \Core\Entity\EntityInterface |
544 | 544 | */ |
545 | - public function getEntity($key='*') |
|
545 | + public function getEntity($key = '*') |
|
546 | 546 | { |
547 | 547 | return isset($this->entities[$key]) ? $this->entities[$key] : null; |
548 | 548 | } |
@@ -745,10 +745,10 @@ discard block |
||
745 | 745 | $actualKey = $this->getActiveFormActual(); |
746 | 746 | if (isset($actualKey)) { |
747 | 747 | $forms = array_keys($this->forms); |
748 | - $formsFlip = array_flip($forms); |
|
748 | + $formsFlip = array_flip($forms); |
|
749 | 749 | $index = $formsFlip[$actualKey]; |
750 | 750 | if (0 < $index) { |
751 | - $key = $forms[$index-1]; |
|
751 | + $key = $forms[$index - 1]; |
|
752 | 752 | } |
753 | 753 | } |
754 | 754 | return $key; |
@@ -765,10 +765,10 @@ discard block |
||
765 | 765 | $actualKey = $this->getActiveFormActual(); |
766 | 766 | if (isset($actualKey)) { |
767 | 767 | $forms = array_keys($this->forms); |
768 | - $formsFlip = array_flip($forms); |
|
768 | + $formsFlip = array_flip($forms); |
|
769 | 769 | $index = $formsFlip[$actualKey]; |
770 | 770 | if ($index < count($forms) - 1) { |
771 | - $key = $forms[$index+1]; |
|
771 | + $key = $forms[$index + 1]; |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 | return $key; |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | */ |
783 | 783 | public function formatAction($name) |
784 | 784 | { |
785 | - return sprintf('%s%s', $this->hasParent() ? $this->getName() . '.' : '', $name); |
|
785 | + return sprintf('%s%s', $this->hasParent() ? $this->getName().'.' : '', $name); |
|
786 | 786 | } |
787 | 787 | |
788 | 788 | /** |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | public function getActionFor($key) |
793 | 793 | { |
794 | 794 | if (isset($this->forms[$key])) { |
795 | - return '?form=' . $this->formatAction($this->forms[$key]['name']); |
|
795 | + return '?form='.$this->formatAction($this->forms[$key]['name']); |
|
796 | 796 | } |
797 | 797 | } |
798 | 798 | } |
799 | 799 | \ No newline at end of file |