Passed
Pull Request — master (#631)
by ANTHONIUS
08:16
created
module/Core/src/Entity/FileTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,17 +94,17 @@
 block discarded – undo
94 94
         $size = $this->getLength();
95 95
 
96 96
         if ($size >= 1073741824) {
97
-            return round($size / 1073741824, 2) . ' GB';
97
+            return round($size / 1073741824, 2).' GB';
98 98
         }
99 99
 
100 100
         if ($size >= 1048576) {
101
-            return round($size / 1048576, 2) . ' MB';
101
+            return round($size / 1048576, 2).' MB';
102 102
         }
103 103
 
104 104
         if ($size >= 1024) {
105
-            return round($size / 1024, 2) . ' kB';
105
+            return round($size / 1024, 2).' kB';
106 106
         }
107 107
 
108
-        return (string)$size;
108
+        return (string) $size;
109 109
     }
110 110
 }
111 111
\ No newline at end of file
Please login to merge, or discard this patch.
module/Core/src/Options/ImageSetOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * Image specifications.
42 42
      */
43 43
     protected array $images = [
44
-        ImageSetInterface::THUMBNAIL => [100,100],
44
+        ImageSetInterface::THUMBNAIL => [100, 100],
45 45
     ];
46 46
 
47 47
     /**
Please login to merge, or discard this patch.
module/Core/src/Repository/DoctrineMongoODM/DocumentManagerFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@
 block discarded – undo
69 69
         $proxyDir = $config->getProxyDir();
70 70
         $hydratorDir = $config->getHydratorDir();
71 71
 
72
-        if(!is_dir($proxyDir)){
72
+        if (!is_dir($proxyDir)) {
73 73
             mkdir($proxyDir, 0777, true);
74 74
         }
75 75
 
76
-        if(!is_dir($hydratorDir)){
76
+        if (!is_dir($hydratorDir)) {
77 77
             mkdir($hydratorDir, 0777, true);
78 78
         }
79 79
     }
Please login to merge, or discard this patch.
module/Core/src/Repository/DoctrineMongoODM/Types/TimezoneAwareDate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         
56 56
         $timezone  = $value->getTimezone()->getName();
57 57
         $timestamp = $value->getTimestamp();
58
-        $date      = new UTCDateTime($timestamp*1000);
58
+        $date      = new UTCDateTime($timestamp * 1000);
59 59
         
60 60
         return array(
61 61
             'date' => $date,
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function closureToDatabase()
73 73
     {
74 74
         return '
75
-            /* CODE FROM: ' . __METHOD__ . ' */
75
+            /* CODE FROM: ' . __METHOD__.' */
76 76
             if (!$value instanceOf \DateTime) return null;
77 77
             $return = array(
78 78
                 "date" => new UTCDateTime($value->getTimestamp()),
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     public function closureToPhp(): string
115 115
     {
116 116
         return '
117
-            /* CODE FROM: ' . __METHOD__ . ' */
117
+            /* CODE FROM: ' . __METHOD__.' */
118 118
             if (!is_array($value) 
119 119
                 || !isset($value["date"]) 
120 120
                 || is_null($value["date"])
Please login to merge, or discard this patch.
module/Core/src/Repository/RepositoryService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $name = "\\$namespace\\Entity\\$entityName";
39 39
         }
40 40
         
41
-        $repository  = $this->dm->getRepository($name);
41
+        $repository = $this->dm->getRepository($name);
42 42
 
43 43
         if (!$repository instanceof AbstractRepository) {
44 44
             $eventArgs = new DoctrineMongoODM\Event\EventArgs(
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function flush($entity = null, array $options = array())
68 68
     {
69
-        if(!is_null($entity)){
69
+        if (!is_null($entity)) {
70 70
             $this->dm->persist($entity);
71 71
         }
72 72
         $this->dm->flush();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         && $events->dispatchEvent('postCommit', new EventArgs(array('document' => $entity, 'documentManager' => $this->dm)));
76 76
     }
77 77
 
78
-    public function remove(EntityInterface $entity, $flush=false)
78
+    public function remove(EntityInterface $entity, $flush = false)
79 79
     {
80 80
         $dm     = $this->dm;
81 81
         $events = $dm->getEventManager();
Please login to merge, or discard this patch.
module/Core/src/Form/RatingFieldset.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $properties = $refl->getProperties();
50 50
         
51 51
         foreach ($properties as $property) {
52
-            $name  = $property->getName();
52
+            $name = $property->getName();
53 53
 
54 54
             // @TODO: check if '-' check is necessary
55 55
             if (
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 continue;
60 60
             }
61 61
 
62
-            $value = $rating->{'get' . $name}();
62
+            $value = $rating->{'get'.$name}();
63 63
             $input = array(
64 64
                 'type' => 'Core/Rating',
65 65
                 'name' => $name,
Please login to merge, or discard this patch.
module/Core/src/Form/View/Helper/FormFileUpload.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
     </a>
91 91
     <div class="fu-errors input-error">
92 92
         <ul class="errors">
93
-            <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain) . '</li>
94
-            <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain) . '</li>
93
+            <li class="fu-error-size">' . $translator->translate('The file is too big', $textDomain).'</li>
94
+            <li class="fu-error-type">' . $translator->translate('The file type is not supported', $textDomain).'</li>
95 95
             <li class="fu-error-count">' . sprintf(
96 96
     $translator->translate('You may only upload %d files', $textDomain),
97 97
     $element->getAttribute('data-maxfilecount')
98
-) . '</li><li class="fu-error-general">' . $translator->translate('An unknown error occured.') . '</li>
98
+).'</li><li class="fu-error-general">'.$translator->translate('An unknown error occured.').'</li>
99 99
         </ul>
100 100
    </div>
101 101
 </li>';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         /* @var $basepath \Laminas\View\Helper\BasePath */
104 104
         $renderer          = $this->getView();
105 105
         $basepath          = $renderer->plugin('basepath');
106
-        $createFileDisplay = function ($file) use ($template, $basepath) {
106
+        $createFileDisplay = function($file) use ($template, $basepath) {
107 107
             /* @var $file \Core\Entity\FileInterface */
108 108
             $uri  = $basepath($file->getUri());
109 109
             $name = $file->getMetadata()->getName();
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         $nonemptynotice =
140
-            '<div class="fu-nonempty-notice"' . ('' == trim($preview) ? ' style="display:none;"' : '') . '>'
141
-            . $this->getNonEmptyNotice() . '</div>';
140
+            '<div class="fu-nonempty-notice"'.('' == trim($preview) ? ' style="display:none;"' : '').'>'
141
+            . $this->getNonEmptyNotice().'</div>';
142 142
         $emptynotice    = '<div class="fu-empty-notice"'
143
-                          . ('' == trim($preview) ? '' : ' style="display: none;"') . '>
144
-                       ' . $this->getEmptyNotice() . '
143
+                          . ('' == trim($preview) ? '' : ' style="display: none;"').'>
144
+                       ' . $this->getEmptyNotice().'
145 145
                   </div>';
146 146
 
147 147
         $markup = '
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      */
289 289
     protected function getDefaultNotice()
290 290
     {
291
-        return '<small>' . $this->getTranslator()->translate('Click here to add files or use drag and drop.') . '</small>';
291
+        return '<small>'.$this->getTranslator()->translate('Click here to add files or use drag and drop.').'</small>';
292 292
     }
293 293
     
294 294
     /**
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function setAllowRemove($allowRemove)
300 300
     {
301
-        $this->allowRemove = (bool)$allowRemove;
301
+        $this->allowRemove = (bool) $allowRemove;
302 302
         
303 303
         return $this;
304 304
     }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function setAllowClickableDropZone($allowClickableDropZone)
312 312
     {
313
-        $this->allowClickableDropZone = (bool)$allowClickableDropZone;
313
+        $this->allowClickableDropZone = (bool) $allowClickableDropZone;
314 314
         
315 315
         return $this;
316 316
     }
Please login to merge, or discard this patch.
module/Core/src/Form/View/Helper/FormImageUpload.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,15 +33,15 @@
 block discarded – undo
33 33
         if ($file && !is_null($file->getMetadata())) {
34 34
             $metadata = $file->getMetadata();
35 35
             if (0 === strpos($metadata->getContentType(), 'image/')) {
36
-                $basepath  = $this->getView()->plugin('basepath');
37
-                $preview = '<img src="' . $basepath($file->getUri()) . '" class="img-polaroid" />';
36
+                $basepath = $this->getView()->plugin('basepath');
37
+                $preview = '<img src="'.$basepath($file->getUri()).'" class="img-polaroid" />';
38 38
             } else {
39
-                $preview = '<span>' . $file->getName() . '(' . $file->getPrettySize() . ')</span>';
39
+                $preview = '<span>'.$file->getName().'('.$file->getPrettySize().')</span>';
40 40
             }
41 41
         }
42 42
         $notice = '<div class="iu-empty-notice" style="padding: 10px; color: #d3d3d3;">
43 43
                             <div style="padding: 0px 20px 5px;"><span class="yk-icon fa-file-image-o fa-5x"></span></div>
44
-                            <small>' . $translator->translate('Click here to add an image or use drag and drop.') . '</small>
44
+                            <small>' . $translator->translate('Click here to add an image or use drag and drop.').'</small>
45 45
                             
46 46
                         </div>';
47 47
         
Please login to merge, or discard this patch.
module/Core/src/Form/View/Helper/SummaryForm.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $renderer->headscript()->appendFile($renderer->basepath('modules/Core/js/jquery.summary-form.js'));
68 68
         
69 69
         $label = $form->getLabel();
70
-        $labelContent = $label ? '<div class="sf-headline"><h3>' . $this->getView()->translate($label) . '</h3></div>' : '';
70
+        $labelContent = $label ? '<div class="sf-headline"><h3>'.$this->getView()->translate($label).'</h3></div>' : '';
71 71
         $formContent  = $this->renderForm($form, $layout, $parameter);
72 72
         $summaryContent = $this->renderSummary($form);
73 73
         
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
     public function renderForm(SummaryFormInterface $form, $layout = Form::LAYOUT_HORIZONTAL, $parameter = array())
133 133
     {
134 134
         /* @var $form SummaryFormInterface|\Core\Form\SummaryForm */
135
-        $renderer     = $this->getView();           /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
136
-        $formHelper   = $renderer->plugin('form');  /* @var $formHelper \Core\Form\View\Helper\Form */
135
+        $renderer     = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
136
+        $formHelper   = $renderer->plugin('form'); /* @var $formHelper \Core\Form\View\Helper\Form */
137 137
         $fieldset     = $form->getBaseFieldset();
138 138
         $resetPartial = false;
139 139
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $form->prepare();
168 168
         $baseFieldset = $form->getBaseFieldset();
169 169
         if (!isset($baseFieldset)) {
170
-            throw new \InvalidArgumentException('For the Form ' . get_class($form) . ' there is no Basefieldset');
170
+            throw new \InvalidArgumentException('For the Form '.get_class($form).' there is no Basefieldset');
171 171
         }
172 172
 
173 173
         $dataAttributesMarkup = '';
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             }
179 179
         }
180 180
         
181
-        $markup = '<div class="panel panel-default" style="min-height: 100px;"' . $dataAttributesMarkup . '>
181
+        $markup = '<div class="panel panel-default" style="min-height: 100px;"'.$dataAttributesMarkup.'>
182 182
                     <div class="panel-body"><div class="sf-controls">%s</div>%s</div></div>';
183 183
 
184 184
         $view = $this->getView();
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
                         . '</button>';
191 191
         
192 192
         if (($controlButtons = $form->getOption('control_buttons')) !== null) {
193
-            $buttonMarkup .= PHP_EOL . implode(PHP_EOL, array_map(function (array $buttonSpec) use ($view) {
194
-                return '<button type="button" class="btn btn-default btn-xs' . (isset($buttonSpec['class']) ? ' ' . $buttonSpec['class'] : '') . '">'
195
-                    . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-' . $buttonSpec['icon'] . '"></span> ' : '')
193
+            $buttonMarkup .= PHP_EOL.implode(PHP_EOL, array_map(function(array $buttonSpec) use ($view) {
194
+                return '<button type="button" class="btn btn-default btn-xs'.(isset($buttonSpec['class']) ? ' '.$buttonSpec['class'] : '').'">'
195
+                    . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-'.$buttonSpec['icon'].'"></span> ' : '')
196 196
                     . $view->translate($buttonSpec['label'])
197 197
                     . '</button>';
198 198
             }, $controlButtons));
@@ -232,10 +232,10 @@  discard block
 block discarded – undo
232 232
         }
233 233
 
234 234
         if ($element instanceof ViewPartialProviderInterface) {
235
-            $renderer    = $this->getView();                 /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
235
+            $renderer    = $this->getView(); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
236 236
             $origPartial = $element->getViewPartial();
237 237
             $partial     = "$origPartial.view";
238
-            $partialParams  = array(
238
+            $partialParams = array(
239 239
                 'element' => $element
240 240
             );
241 241
             if (!$renderer->resolver($partial)) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         
252 252
         if ($element instanceof FieldsetInterface) {
253 253
             if (!$element instanceof FormInterface && $label) {
254
-                $markup .= '<h4>' . $label . '</h4>';
254
+                $markup .= '<h4>'.$label.'</h4>';
255 255
             }
256 256
             foreach ($element as $el) {
257 257
                 $markup .= $this->renderSummaryElement($el);
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
                             }
284 284
 
285 285
                             $optGroupLabel = isset($optVal['label']) ? $translator->translate($optVal['label']) : $optKey;
286
-                            $multiOptions[] = $optGroupLabel . ' | ' . $translator->translate($optVal['options'][$optionKey]);
286
+                            $multiOptions[] = $optGroupLabel.' | '.$translator->translate($optVal['options'][$optionKey]);
287 287
                         }
288 288
                     }
289 289
 
290
-                    $elementValue = '<ul><li>' . join('</li><li>', $multiOptions) . '</li></ul>';
290
+                    $elementValue = '<ul><li>'.join('</li><li>', $multiOptions).'</li></ul>';
291 291
                 } else {
292 292
                     $elementValue = $translator->translate($options[$elementValue]);
293 293
                 }
@@ -301,13 +301,13 @@  discard block
 block discarded – undo
301 301
         $markup .= '<div class="row">';
302 302
         $col = 12;
303 303
         if ($label) {
304
-            $markup .= '<div class="col-md-3 yk-label"><label>' . $label . '</label></div>';
304
+            $markup .= '<div class="col-md-3 yk-label"><label>'.$label.'</label></div>';
305 305
             $col = 9;
306 306
         }
307
-        if(is_array($elementValue)){
307
+        if (is_array($elementValue)) {
308 308
             $elementValue = implode(",", $elementValue);
309 309
         }
310
-        $markup .= '<div class="col-md-' . $col . '">' . $elementValue . '</div>'
310
+        $markup .= '<div class="col-md-'.$col.'">'.$elementValue.'</div>'
311 311
             . '</div>';
312 312
         return $markup;
313 313
     }
Please login to merge, or discard this patch.