Completed
Push — master ( 626779...501cbf )
by Abdul Malik
07:17 queued 04:25
created
module/LearnZF2FormUsage/src/LearnZF2FormUsage/Form/LearnZF2Form.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
                 'required' => false,
153 153
                 'allow_empty' => true,
154 154
                 'filters' => [
155
-                    ['name' => 'Int'],
155
+                    [ 'name' => 'Int' ],
156 156
                 ],
157 157
             ],
158 158
             [
159 159
                 'name' => 'name',
160 160
                 'required' => true,
161 161
                 'filters' => [
162
-                    ['name' => 'StripTags'],
163
-                    ['name' => 'StringTrim'],
162
+                    [ 'name' => 'StripTags' ],
163
+                    [ 'name' => 'StringTrim' ],
164 164
                 ],
165 165
                 'validators' => [
166 166
                     [
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                     [
180 180
                         'name' => 'InArray',
181 181
                         'options' => [
182
-                            'haystack' => [2, 3],
182
+                            'haystack' => [ 2, 3 ],
183 183
                             'messages' => [
184 184
                                 'notInArray' => 'Please select your gender !',
185 185
                             ],
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
                 'name' => 'address',
216 216
                 'required' => true,
217 217
                 'filters' => [
218
-                    ['name' => 'StripTags'],
219
-                    ['name' => 'StringTrim'],
218
+                    [ 'name' => 'StripTags' ],
219
+                    [ 'name' => 'StringTrim' ],
220 220
                 ],
221 221
                 'validators' => [
222 222
                     [
Please login to merge, or discard this patch.
module/LearnZF2Themes/Module.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         $eventManager = $app->getEventManager();
44 44
         $sharedEventManager = $eventManager->getSharedManager();
45 45
 
46
-        $eventManager->attach('render', [$this, 'loadTheme'], 100);
47
-        $sharedEventManager->attach(ReloadService::class, 'reload', [$this, 'reloadConfig'], 100);
46
+        $eventManager->attach('render', [ $this, 'loadTheme' ], 100);
47
+        $sharedEventManager->attach(ReloadService::class, 'reload', [ $this, 'reloadConfig' ], 100);
48 48
     }
49 49
 
50 50
     /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         $config = $this->service->get('Config');
58 58
         $this->service->setAllowOverride(true);
59
-        $config['theme']['name'] = $request->getPost()['themeName'];
59
+        $config[ 'theme' ][ 'name' ] = $request->getPost()[ 'themeName' ];
60 60
         $this->service->setService('Config', $config);
61 61
         $this->service->setAllowOverride(false);
62 62
     }
Please login to merge, or discard this patch.
module/LearnZF2Themes/src/LearnZF2Themes/Controller/IndexController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     /**
30 30
      * @var array
31 31
      */
32
-    private $themesConfig = [];
32
+    private $themesConfig = [ ];
33 33
 
34 34
     /**
35 35
      * @var mixed
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
         if ($request->isPost()) {
62 62
             $filename = __DIR__.'/../../../config/module.config.php';
63 63
             $settings = include $filename;
64
-            $themeName = $request->getPost()['themeName'];
65
-            $settings['theme']['name'] = $themeName;
64
+            $themeName = $request->getPost()[ 'themeName' ];
65
+            $settings[ 'theme' ][ 'name' ] = $themeName;
66 66
             file_put_contents($filename, '<?php return '.var_export($settings, true).';');
67 67
             $this->reloadService->reload();
68 68
         }
Please login to merge, or discard this patch.
src/LearnZF2AjaxImageGallery/Controller/IndexController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
      * @var array
38 38
      */
39 39
     protected $acceptCriteria = [
40
-        'Zend\View\Model\JsonModel' => ['application/json'],
41
-        'Zend\View\Model\ViewModel' => ['text/html'],
40
+        'Zend\View\Model\JsonModel' => [ 'application/json' ],
41
+        'Zend\View\Model\ViewModel' => [ 'text/html' ],
42 42
     ];
43 43
 
44 44
     /**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     protected function uploadAction()
87 87
     {
88 88
         $request = $this->getRequest();
89
-        $data = [];
89
+        $data = [ ];
90 90
 
91 91
         if ($request->isXmlHttpRequest()) {
92 92
             $data = $this->prepareImages();
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
             $data = $request->getPost()->toArray();
112 112
 
113 113
             if ($request->isXmlHttpRequest()) {
114
-                if (is_file('public'.$data['img'])) {
115
-                    unlink('public'.$data['img']);
114
+                if (is_file('public'.$data[ 'img' ])) {
115
+                    unlink('public'.$data[ 'img' ]);
116 116
                     $status = true;
117 117
                 }
118 118
             }
@@ -134,18 +134,18 @@  discard block
 block discarded – undo
134 134
         $dir = new \RecursiveDirectoryIterator('userfiles/', \FilesystemIterator::SKIP_DOTS);
135 135
         $it = new \RecursiveIteratorIterator($dir, \RecursiveIteratorIterator::SELF_FIRST);
136 136
         $it->setMaxDepth(50);
137
-        $files = [];
137
+        $files = [ ];
138 138
         $i = 0;
139 139
         foreach ($it as $file) {
140 140
             if ($file->isFile()) {
141
-                $files[$i]['filelink'] = DIRECTORY_SEPARATOR.$file->getPath().DIRECTORY_SEPARATOR.$file->getFilename();
142
-                $files[$i]['filename'] = $file->getFilename();
141
+                $files[ $i ][ 'filelink' ] = DIRECTORY_SEPARATOR.$file->getPath().DIRECTORY_SEPARATOR.$file->getFilename();
142
+                $files[ $i ][ 'filename' ] = $file->getFilename();
143 143
                 $i++;
144 144
             }
145 145
         }
146 146
         chdir(dirname(getcwd()));
147 147
         $model = new JsonModel();
148
-        $model->setVariables(['files' => $files]);
148
+        $model->setVariables([ 'files' => $files ]);
149 149
 
150 150
         return $model;
151 151
     }
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
     {
160 160
         $adapter = new Http();
161 161
 
162
-        $size = new Size(['min' => '10kB', 'max' => '5MB', 'useByteString' => true]);
163
-        $extension = new Extension(['jpg', 'gif', 'png', 'jpeg', 'bmp', 'webp', 'svg'], true);
162
+        $size = new Size([ 'min' => '10kB', 'max' => '5MB', 'useByteString' => true ]);
163
+        $extension = new Extension([ 'jpg', 'gif', 'png', 'jpeg', 'bmp', 'webp', 'svg' ], true);
164 164
 
165 165
         if (extension_loaded('fileinfo')) {
166
-            $adapter->setValidators([new IsImage()]);
166
+            $adapter->setValidators([ new IsImage() ]);
167 167
         }
168 168
 
169
-        $adapter->setValidators([$size, $extension]);
169
+        $adapter->setValidators([ $size, $extension ]);
170 170
 
171 171
         $adapter->setDestination('public/userfiles/images/');
172 172
 
@@ -180,20 +180,20 @@  discard block
 block discarded – undo
180 180
      */
181 181
     private function uploadFiles(Http $adapter)
182 182
     {
183
-        $uploadStatus = [];
183
+        $uploadStatus = [ ];
184 184
 
185 185
         foreach ($adapter->getFileInfo() as $key => $file) {
186
-            if (!$adapter->isValid($file['name'])) {
186
+            if (!$adapter->isValid($file[ 'name' ])) {
187 187
                 foreach ($adapter->getMessages() as $key => $msg) {
188
-                    $uploadStatus['errorFiles'][] = $file['name'].' '.strtolower($msg);
188
+                    $uploadStatus[ 'errorFiles' ][ ] = $file[ 'name' ].' '.strtolower($msg);
189 189
                 }
190 190
             }
191 191
 
192 192
             // @codeCoverageIgnoreStart
193
-            if (!$adapter->receive($file['name'])) {
194
-                $uploadStatus['errorFiles'][] = $file['name'].' was not uploaded';
193
+            if (!$adapter->receive($file[ 'name' ])) {
194
+                $uploadStatus[ 'errorFiles' ][ ] = $file[ 'name' ].' was not uploaded';
195 195
             } else {
196
-                $uploadStatus['successFiles'][] = $file['name'].' was successfully uploaded';
196
+                $uploadStatus[ 'successFiles' ][ ] = $file[ 'name' ].' was successfully uploaded';
197 197
             }
198 198
             // @codeCoverageIgnoreEnd
199 199
         }
Please login to merge, or discard this patch.
module/LearnZF2Ajax/src/LearnZF2Ajax/Controller/IndexController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 class IndexController extends AbstractActionController
19 19
 {
20 20
     protected $acceptCriteria = [
21
-        'Zend\View\Model\JsonModel' => ['application/json'],
22
-        'Zend\View\Model\ViewModel' => ['text/html'],
21
+        'Zend\View\Model\JsonModel' => [ 'application/json' ],
22
+        'Zend\View\Model\ViewModel' => [ 'text/html' ],
23 23
     ];
24 24
 
25 25
     /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function indexAction()
36 36
     {
37
-        $result = ['result' => false, 'message' => ''];
37
+        $result = [ 'result' => false, 'message' => '' ];
38 38
         $viewModel = $this->acceptableviewmodelselector($this->acceptCriteria);
39 39
 
40 40
         $request = $this->getRequest();
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
             $this->loginForm->setData($request->getPost());
45 45
 
46 46
             if ($this->loginForm->isValid()) {
47
-                $result = ['result' => true, 'message' => 'Ajax request success'];
47
+                $result = [ 'result' => true, 'message' => 'Ajax request success' ];
48 48
             } else {
49
-                $result = ['result' => false, 'message' => $this->loginForm->getMessages()];
49
+                $result = [ 'result' => false, 'message' => $this->loginForm->getMessages() ];
50 50
             }
51 51
         }
52 52
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $viewModel = new JsonModel();
55 55
         }
56 56
 
57
-        $viewModel->setVariables(['form' => $this->loginForm, 'data' => $result]);
57
+        $viewModel->setVariables([ 'form' => $this->loginForm, 'data' => $result ]);
58 58
 
59 59
         return $viewModel;
60 60
     }
Please login to merge, or discard this patch.