Passed
Push — master ( 240c83...03f39b )
by Mathias
06:41
created
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.
module/Auth/src/Auth/Service/UploadHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
         $fileManager = $this->fileManager;
54 54
         $metadata = new ImageMetadata();
55 55
 
56
-        if(!is_null($image = $user->getInfo()->getImage())){
56
+        if (!is_null($image = $user->getInfo()->getImage())) {
57 57
             $user->getInfo()->setImage(null);
58 58
             $this->dm->persist($user);
59 59
             $this->dm->flush();
Please login to merge, or discard this patch.
module/Auth/src/Auth/Controller/ManageController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
         /* @var \Auth\Form\UserProfileContainer $userProfileContainer */
107 107
         $userProfileContainer = $this->userProfileContainer;
108 108
         $user = $this->authService->getUser(); /* @var $user \Auth\Entity\User */
109
-        $postProfiles = (array)$this->params()->fromPost('social_profiles');
109
+        $postProfiles = (array) $this->params()->fromPost('social_profiles');
110 110
         $userProfiles = $user->getProfile();
111 111
         $formSocialProfiles = $this->socialProfileForm
112 112
             ->setUseDefaultValidation(true)
113
-            ->setData(['social_profiles' => array_map(function ($array)
113
+            ->setData(['social_profiles' => array_map(function($array)
114 114
             {
115 115
                 return $array['data'];
116 116
             }, $userProfiles)]);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             $formName  = $this->params()->fromQuery('form');
129 129
             $form      = $userProfileContainer->getForm($formName);
130 130
 
131
-            if(!is_null($form) && 'info.image' === $formName) {
131
+            if (!is_null($form) && 'info.image' === $formName) {
132 132
                 $user = $this->manageHandler->handleUpload($user, $_FILES['image']);
133 133
                 $form->getParent()->setEntity($user->getInfo());
134 134
                 $content = $this->viewHelper->get('form')->__invoke($form);
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
                         'content' => $content,
139 139
                     )
140 140
                 );
141
-            }elseif($form) {
142
-                $postData  = $form->getOption('use_post_array') ? $_POST : array();
141
+            }elseif ($form) {
142
+                $postData = $form->getOption('use_post_array') ? $_POST : array();
143 143
                 //@TODO: [ZF3] option use_files_array is false by default
144 144
                 //$filesData = $form->getOption('use_files_array') ? $_FILES : array();
145 145
 	            $filesData = $_FILES;
146
-                $data      = array_merge($postData, $filesData);
146
+                $data = array_merge($postData, $filesData);
147 147
                 $form->setData($data);
148 148
 
149 149
                 if (!$form->isValid()) {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                                 ));
203 203
                             } else {
204 204
                                 $profile = [
205
-                                    'auth' => (array)$authProfile,
205
+                                    'auth' => (array) $authProfile,
206 206
                                     'data' => \Laminas\Json\Json::decode($dataProfiles[$network])
207 207
                                 ];
208 208
                                 $user->addProfile($network, $profile);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                 }
213 213
                 
214 214
                 // keep data in sync & properly decoded
215
-                $formSocialProfiles->setData(['social_profiles' => array_map(function ($array)
215
+                $formSocialProfiles->setData(['social_profiles' => array_map(function($array)
216 216
                 {
217 217
                     return \Laminas\Json\Json::decode($array) ?: '';
218 218
                 }, $dataProfiles)]);
Please login to merge, or discard this patch.
module/Auth/src/Auth/Entity/UserImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
      */
30 30
     public function getUri(): string
31 31
     {
32
-        return '/file/Auth.UserImage/' . $this->id;
32
+        return '/file/Auth.UserImage/'.$this->id;
33 33
     }
34 34
 
35 35
     /**
Please login to merge, or discard this patch.
module/Auth/src/Auth/Repository/User.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @see \Core\Repository\AbstractRepository::create()
103 103
      * @return UserInterface
104 104
      */
105
-    public function create(array $data = null, $persist=false)
105
+    public function create(array $data = null, $persist = false)
106 106
     {
107 107
         $entity = parent::create($data);
108 108
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function findByProfileIdentifier($identifier, $provider, array $options = [])
126 126
     {
127
-        return $this->findOneBy(array('profiles.' . $provider . '.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options);
127
+        return $this->findOneBy(array('profiles.'.$provider.'.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options);
128 128
     }
129 129
 
130 130
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $qb->field('_id')->notEqual($curentUserId)
142 142
             ->addAnd(
143 143
                 $qb->expr()
144
-                    ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier))
144
+                    ->addOr($qb->expr()->field('profiles.'.$provider.'.auth.identifier')->equals($identifier))
145 145
                     ->addOr($qb->expr()->field('profile.identifier')->equals($identifier))
146 146
             );
147 147
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         return $this->findOneBy(
198 198
             array(
199 199
             '$or' => array(
200
-                array('login' => $identity . $suffix),
200
+                array('login' => $identity.$suffix),
201 201
                 array('info.email' => $identity)
202 202
             )
203 203
             )
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
     public function findByQuery($query)
247 247
     {
248 248
         $qb = $this->createQueryBuilder();
249
-        $parts  = explode(' ', trim($query));
249
+        $parts = explode(' ', trim($query));
250 250
 
251 251
         foreach ($parts as $q) {
252
-            $regex = new Regex('/^' . $query . '/i');
252
+            $regex = new Regex('/^'.$query.'/i');
253 253
             $qb->addOr($qb->expr()->field('info.firstName')->equals($regex));
254 254
             $qb->addOr($qb->expr()->field('info.lastName')->equals($regex));
255 255
             $qb->addOr($qb->expr()->field('info.email')->equals($regex));
Please login to merge, or discard this patch.
module/Install/src/Factory/Controller/Plugin/UserCreatorFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 
52 52
         $config = $container->get('doctrine.documentmanager.odm_default')->getConfiguration();
53 53
         $config->setDefaultDB($database);
54
-        $dm = $this->createDocumentManager($options['connection'],$config);
54
+        $dm = $this->createDocumentManager($options['connection'], $config);
55 55
 
56
-        $plugin = new UserCreator($credentialFilter,$dm);
56
+        $plugin = new UserCreator($credentialFilter, $dm);
57 57
         return $plugin;
58 58
     }
59 59
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function createDocumentManager($connection, $config)
69 69
     {
70
-        try{
70
+        try {
71 71
             $dbConn = new Client($connection, [], [
72 72
                 'typeMap' => [
73 73
                     'root' => 'array',
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
                 ]
76 76
             ]);
77 77
             $dbConn->selectDatabase('YAWIK');
78
-            $dm = DocumentManager::create($dbConn,$config);
78
+            $dm = DocumentManager::create($dbConn, $config);
79 79
             return $dm;
80
-        }catch (\Exception $e){
80
+        } catch (\Exception $e) {
81 81
             throw new \Exception("Can't create document manager: {$e->getMessage()}");
82 82
         }
83 83
     }
Please login to merge, or discard this patch.