@@ -149,21 +149,21 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | if (preg_match('~^is(View|Change|None|All)Granted$~', $method, $match)) { |
152 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
152 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
153 | 153 | return $this->isGranted($params[0], $permission); |
154 | 154 | } |
155 | 155 | |
156 | 156 | if (preg_match('~^grant(View|Change|None|All)$~', $method, $match)) { |
157 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
157 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
158 | 158 | return $this->grant($params[0], $permission); |
159 | 159 | } |
160 | 160 | |
161 | 161 | if (preg_match('~^revoke(View|Change|None|All)$~', $method, $match)) { |
162 | - $permission = constant('self::PERMISSION_' . strtoupper($match[1])); |
|
162 | + $permission = constant('self::PERMISSION_'.strtoupper($match[1])); |
|
163 | 163 | return $this->revoke($params[0], $permission); |
164 | 164 | } |
165 | 165 | |
166 | - throw new \BadMethodCallException('Unknown method "' . $method . '"'); |
|
166 | + throw new \BadMethodCallException('Unknown method "'.$method.'"'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if ($build) { |
312 | 312 | $this->build(); |
313 | 313 | } |
314 | - $this->hasChanged= true; |
|
314 | + $this->hasChanged = true; |
|
315 | 315 | |
316 | 316 | // restore orginial permissions type |
317 | 317 | $this->type = $oldType; |
@@ -444,10 +444,10 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | if ($resource instanceof UserInterface) { |
447 | - return 'user:' . $resource->getId(); |
|
447 | + return 'user:'.$resource->getId(); |
|
448 | 448 | } |
449 | 449 | |
450 | - return 'user:' . $resource; |
|
450 | + return 'user:'.$resource; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | ); |
468 | 468 | if (!in_array($permission, $perms)) { |
469 | 469 | throw new \InvalidArgumentException( |
470 | - 'Invalid permission. Must be one of ' . implode(', ', $perms) |
|
470 | + 'Invalid permission. Must be one of '.implode(', ', $perms) |
|
471 | 471 | ); |
472 | 472 | } |
473 | 473 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $this->$method($value); |
50 | 50 | } |
51 | 51 | |
52 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this). "'"); |
|
52 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (method_exists($this, $method)) { |
77 | 77 | return $this->$method(); |
78 | 78 | } |
79 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
79 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -66,13 +66,13 @@ |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | $output = '<div class="br-widget br-readonly ' |
69 | - . ('compact' == $mode ? ' br-compact' : '' ) |
|
70 | - . '" title="' . $this->getView()->translate(self::$ratingValueMap[$rating]) . '">'; |
|
71 | - for ($i=1; $i<6; $i++) { |
|
69 | + . ('compact' == $mode ? ' br-compact' : '') |
|
70 | + . '" title="'.$this->getView()->translate(self::$ratingValueMap[$rating]).'">'; |
|
71 | + for ($i = 1; $i < 6; $i++) { |
|
72 | 72 | $class = $i <= $rating ? 'br-selected' : ''; |
73 | 73 | $class .= $i == $rating ? ' br-current' : ''; |
74 | 74 | |
75 | - $output .= '<a class="' . $class . '"></a>'; |
|
75 | + $output .= '<a class="'.$class.'"></a>'; |
|
76 | 76 | } |
77 | 77 | $output .= '</div>'; |
78 | 78 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | : ''; |
59 | 59 | |
60 | 60 | if (false !== strpos($urlOrEmail, '@')) { |
61 | - $urlOrEmail = 'mailto:' . $urlOrEmail; |
|
61 | + $urlOrEmail = 'mailto:'.$urlOrEmail; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return sprintf('<a %s href="%s">%s</a>', $attributesStr, $urlOrEmail, $label); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $attr = array(); |
74 | 74 | |
75 | 75 | foreach ($attributes as $name => $value) { |
76 | - $attr[] = $escape($name) . '="' . $escapeAttr($value) . '"'; |
|
76 | + $attr[] = $escape($name).'="'.$escapeAttr($value).'"'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return implode(' ', $attr); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | protected function checkObjectType($object) |
58 | 58 | { |
59 | 59 | if (!$object instanceof $this->objectType) { |
60 | - throw new \InvalidArgumentException('Wrapped entity must be of type ' . $this->objectType); |
|
60 | + throw new \InvalidArgumentException('Wrapped entity must be of type '.$this->objectType); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | $renderer = $this->getView(); |
51 | 51 | $basepath = $renderer->plugin('basepath'); |
52 | 52 | $renderer->headscript() |
53 | - ->appendFile($basepath('js/jquery-file-upload/vendor/jquery.ui.widget.js')) |
|
54 | - ->appendFile($basepath('js/jquery-file-upload/jquery.iframe-transport.js')) |
|
55 | - ->appendFile($basepath('js/jquery-file-upload/jquery.fileupload.js')) |
|
56 | - ->appendFile($basepath($this->scriptFile)); |
|
53 | + ->appendFile($basepath('js/jquery-file-upload/vendor/jquery.ui.widget.js')) |
|
54 | + ->appendFile($basepath('js/jquery-file-upload/jquery.iframe-transport.js')) |
|
55 | + ->appendFile($basepath('js/jquery-file-upload/jquery.fileupload.js')) |
|
56 | + ->appendFile($basepath($this->scriptFile)); |
|
57 | 57 | |
58 | 58 | $markup = $this->renderMarkup($element); |
59 | 59 | // $fileInput = parent::render($element); |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | |
127 | 127 | return str_replace( |
128 | 128 | array('#abort', |
129 | - '__file-uri__', |
|
130 | - '__file-name__', |
|
131 | - '__file-size__', |
|
132 | - 'fu-working', |
|
133 | - 'fa-file-o' |
|
129 | + '__file-uri__', |
|
130 | + '__file-name__', |
|
131 | + '__file-size__', |
|
132 | + 'fu-working', |
|
133 | + 'fa-file-o' |
|
134 | 134 | ), |
135 | 135 | array("$uri?do=delete", $uri, $name, $size, '', $icon), |
136 | 136 | $template |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | '<div class="fu-nonempty-notice"' . ('' == trim($preview) ? ' style="display:none;"' : '') . '>' |
159 | 159 | . $notice . '</div>'; |
160 | 160 | $emptynotice = '<div class="fu-empty-notice"' |
161 | - . ('' == trim($preview) ? '' : ' style="display: none;"') . '> |
|
161 | + . ('' == trim($preview) ? '' : ' style="display: none;"') . '> |
|
162 | 162 | <div class="pull-left"> |
163 | 163 | <span class="yk-icon fa-files-o fa-5x"></span> |
164 | 164 | </div>' . $notice . ' |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | </a> |
104 | 104 | <div class="fu-errors input-error"> |
105 | 105 | <ul class="errors"> |
106 | - <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain) . '</li> |
|
107 | - <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain) . '</li> |
|
106 | + <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain).'</li> |
|
107 | + <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain).'</li> |
|
108 | 108 | <li class="fu-error-count">' . sprintf( |
109 | 109 | $translator->translate('You may only upload %d files', $textDomain), |
110 | 110 | $element->getAttribute('data-maxfilecount') |
111 | -) . '</li><li class="fu-error-general">' . $translator->translate('An unknown error occured.') . '</li> |
|
111 | +).'</li><li class="fu-error-general">'.$translator->translate('An unknown error occured.').'</li> |
|
112 | 112 | </ul> |
113 | 113 | </div> |
114 | 114 | </li>'; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | /* @var $basepath \Zend\View\Helper\BasePath */ |
117 | 117 | $renderer = $this->getView(); |
118 | 118 | $basepath = $renderer->plugin('basepath'); |
119 | - $createFileDisplay = function ($file) use ($template, $basepath) { |
|
119 | + $createFileDisplay = function($file) use ($template, $basepath) { |
|
120 | 120 | /* @var $file \Core\Entity\FileInterface */ |
121 | 121 | $uri = $basepath($file->getUri()); |
122 | 122 | $name = $file->getName(); |
@@ -153,15 +153,15 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | $notice = |
156 | - '<small>' . $translator->translate('Click here to add files or use drag and drop.') . '</small>'; |
|
156 | + '<small>'.$translator->translate('Click here to add files or use drag and drop.').'</small>'; |
|
157 | 157 | $nonemptynotice = |
158 | - '<div class="fu-nonempty-notice"' . ('' == trim($preview) ? ' style="display:none;"' : '') . '>' |
|
159 | - . $notice . '</div>'; |
|
158 | + '<div class="fu-nonempty-notice"'.('' == trim($preview) ? ' style="display:none;"' : '').'>' |
|
159 | + . $notice.'</div>'; |
|
160 | 160 | $emptynotice = '<div class="fu-empty-notice"' |
161 | - . ('' == trim($preview) ? '' : ' style="display: none;"') . '> |
|
161 | + . ('' == trim($preview) ? '' : ' style="display: none;"').'> |
|
162 | 162 | <div class="pull-left"> |
163 | 163 | <span class="yk-icon fa-files-o fa-5x"></span> |
164 | - </div>' . $notice . ' |
|
164 | + </div>' . $notice.' |
|
165 | 165 | </div>'; |
166 | 166 | |
167 | 167 | $markup = ' |
@@ -39,11 +39,11 @@ |
||
39 | 39 | $element->setLabel(''); |
40 | 40 | $element->setAttribute('placeholder', $label); |
41 | 41 | } |
42 | - $formContent .= $this->getView()->formRow($element, null, null, Form::LAYOUT_BARE) . ' '; |
|
42 | + $formContent .= $this->getView()->formRow($element, null, null, Form::LAYOUT_BARE).' '; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | - return $this->openTag($form) . $formContent . $this->closeTag(); |
|
47 | + return $this->openTag($form).$formContent.$this->closeTag(); |
|
48 | 48 | } |
49 | 49 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | |
53 | 53 | if ($element instanceof ViewPartialProviderInterface && !$ignoreViewPartial) { |
54 | 54 | return $this->getView()->partial($element->getViewPartial(), |
55 | - array( |
|
56 | - 'element' => $element, |
|
57 | - 'labelWitdh' => $labelWidth, |
|
58 | - 'label_attributes' => $labelAttributes |
|
55 | + array( |
|
56 | + 'element' => $element, |
|
57 | + 'labelWitdh' => $labelWidth, |
|
58 | + 'label_attributes' => $labelAttributes |
|
59 | 59 | ) |
60 | 60 | ); |
61 | 61 | } |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | $desc = $element->getOption('description', false); |
108 | 108 | if ($desc && $this->layout != Form::LAYOUT_BARE) { |
109 | 109 | if (null !== ($translator = $this->getTranslator())) { |
110 | - $desc = $translator->translate( |
|
111 | - $desc, |
|
112 | - $this->getTranslatorTextDomain() |
|
113 | - ); |
|
110 | + $desc = $translator->translate( |
|
111 | + $desc, |
|
112 | + $this->getTranslatorTextDomain() |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | $elementString .= sprintf( |
116 | 116 | '<div id="%s-desc" class="cam-description alert alert-info">%s</div>', |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | |
77 | 77 | // Does this element have errors ? |
78 | 78 | if (!empty($elementErrors) && !empty($inputErrorClass) && $this->layout != Form::LAYOUT_BARE) { |
79 | - $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : ''); |
|
80 | - $classAttributes = $classAttributes . $inputErrorClass; |
|
79 | + $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class').' ' : ''); |
|
80 | + $classAttributes = $classAttributes.$inputErrorClass; |
|
81 | 81 | |
82 | 82 | $element->setAttribute('class', $classAttributes); |
83 | 83 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if (!$element->hasAttribute('id')) { |
86 | 86 | $elementId = preg_replace( |
87 | 87 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
88 | - array('-' , '-', ''), |
|
88 | + array('-', '-', ''), |
|
89 | 89 | $element->getName() |
90 | 90 | ); |
91 | 91 | $element->setAttribute('id', $elementId); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | // moved label here so we can change it in the ElementViewHelper |
134 | - $label = $element->getLabel(); |
|
134 | + $label = $element->getLabel(); |
|
135 | 135 | if (isset($label) && '' !== $label && !$element instanceof \Zend\Form\Element\Button) { |
136 | 136 | // Translate the label |
137 | 137 | if (null !== ($translator = $this->getTranslator())) { |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | } |
174 | 174 | $element->setLabelAttributes($labelAttributes); |
175 | 175 | |
176 | - $label = $labelHelper($element,$label); |
|
176 | + $label = $labelHelper($element, $label); |
|
177 | 177 | if ($this->shouldWrap) { |
178 | 178 | $spanWidth = 12 - $labelWidth; |
179 | 179 | $elementString = sprintf( |
180 | - '<div class="col-md-%d%s" id="' . $elementId . '-span">%s</div>', |
|
180 | + '<div class="col-md-%d%s" id="'.$elementId.'-span">%s</div>', |
|
181 | 181 | $spanWidth, |
182 | 182 | $elementErrors ? " $inputErrorClass" : '', |
183 | 183 | $elementString |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ); |
190 | 190 | |
191 | 191 | } |
192 | - $markup = $label . $elementString; |
|
192 | + $markup = $label.$elementString; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | } else { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | && !$element instanceof \Zend\Form\Element\Button |
211 | 211 | && $this->layout != Form::LAYOUT_BARE |
212 | 212 | ) { |
213 | - $markup = sprintf('<div class="controls controls-row ' . $form_row_class . '">%s</div>', $markup); |
|
213 | + $markup = sprintf('<div class="controls controls-row '.$form_row_class.'">%s</div>', $markup); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $markup; |
@@ -71,8 +71,8 @@ |
||
71 | 71 | $basepath = $renderer->plugin('basepath'); |
72 | 72 | |
73 | 73 | $headscript->appendFile($basepath('Core/js/core.spinnerbutton.js')) |
74 | - ->appendFile($basepath('js/select2.min.js')) |
|
75 | - ->appendFile($basepath('Core/js/core.forms.js')); |
|
74 | + ->appendFile($basepath('js/select2.min.js')) |
|
75 | + ->appendFile($basepath('Core/js/core.forms.js')); |
|
76 | 76 | |
77 | 77 | /* @noinspection PhpParamsInspection */ |
78 | 78 | $renderer->headLink()->appendStylesheet($basepath('css/select2.css')); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $class = $form->getAttribute('class'); |
90 | 90 | $class = preg_replace('~\bform-[^ ]+\b~', '', $class); |
91 | - $class .= ' ' . $layout; |
|
91 | + $class .= ' '.$layout; |
|
92 | 92 | |
93 | 93 | $form->setAttribute('class', $class); |
94 | 94 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'id', |
98 | 98 | preg_replace( |
99 | 99 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
100 | - array('-' , '-' , '' ), |
|
100 | + array('-', '-', ''), |
|
101 | 101 | $formId |
102 | 102 | ) |
103 | 103 | ); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (!$element->hasAttribute('id')) { |
119 | 119 | $elementId = preg_replace( |
120 | 120 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
121 | - array('-' , '-', ''), |
|
121 | + array('-', '-', ''), |
|
122 | 122 | $element->getName() |
123 | 123 | ); |
124 | 124 | $element->setAttribute('id', $elementId); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - return $this->openTag($form) . $formContent . $this->closeTag(); |
|
159 | + return $this->openTag($form).$formContent.$this->closeTag(); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ); |
185 | 185 | |
186 | 186 | if ($desc = $form->getOption('description', '')) { |
187 | - $descriptionParams=$form->getOption('description_params'); |
|
187 | + $descriptionParams = $form->getOption('description_params'); |
|
188 | 188 | $translator = $this->getTranslator(); |
189 | 189 | $textDomain = $this->getTranslatorTextDomain(); |
190 | 190 | $desc = $translator->translate($desc, $textDomain); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $desc |
206 | 206 | ); |
207 | 207 | } else { |
208 | - $formContent = '<div class="form-content">' . $formContent . '</div>'; |
|
208 | + $formContent = '<div class="form-content">'.$formContent.'</div>'; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | $markup = '<div id="form-%s" class="form-container">' |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | . '</div>'; |
215 | 215 | |
216 | 216 | if ($label = $form->getLabel()) { |
217 | - $label = '<div class="form-headline"><h3>' . $renderer->translate($label) . '</h3></div>'; |
|
217 | + $label = '<div class="form-headline"><h3>'.$renderer->translate($label).'</h3></div>'; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | return sprintf( |