@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | * @var array |
39 | 39 | */ |
40 | 40 | protected $acceptCriteria = [ |
41 | - 'Zend\View\Model\JsonModel' => ['application/json'], |
|
42 | - 'Zend\View\Model\ViewModel' => ['text/html'], |
|
41 | + 'Zend\View\Model\JsonModel' => [ 'application/json' ], |
|
42 | + 'Zend\View\Model\ViewModel' => [ 'text/html' ], |
|
43 | 43 | ]; |
44 | 44 | |
45 | 45 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | protected function uploadAction() |
88 | 88 | { |
89 | 89 | $request = $this->getRequest(); |
90 | - $data = []; |
|
90 | + $data = [ ]; |
|
91 | 91 | |
92 | 92 | if ($request->isXmlHttpRequest()) { |
93 | 93 | $data = $this->prepareImages(); |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | $data = $request->getPost()->toArray(); |
113 | 113 | |
114 | 114 | if ($request->isXmlHttpRequest()) { |
115 | - if (is_file('public'.$data['img'])) { |
|
116 | - unlink('public'.$data['img']); |
|
115 | + if (is_file('public'.$data[ 'img' ])) { |
|
116 | + unlink('public'.$data[ 'img' ]); |
|
117 | 117 | $status = true; |
118 | 118 | } |
119 | 119 | } |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | $dir = new \RecursiveDirectoryIterator('userfiles/', \FilesystemIterator::SKIP_DOTS); |
136 | 136 | $it = new \RecursiveIteratorIterator($dir, \RecursiveIteratorIterator::SELF_FIRST); |
137 | 137 | $it->setMaxDepth(50); |
138 | - $files = []; |
|
138 | + $files = [ ]; |
|
139 | 139 | $i = 0; |
140 | 140 | foreach ($it as $file) { |
141 | 141 | if ($file->isFile()) { |
142 | - $files[$i]['filelink'] = DIRECTORY_SEPARATOR.$file->getPath().DIRECTORY_SEPARATOR.$file->getFilename(); |
|
143 | - $files[$i]['filename'] = $file->getFilename(); |
|
142 | + $files[ $i ][ 'filelink' ] = DIRECTORY_SEPARATOR.$file->getPath().DIRECTORY_SEPARATOR.$file->getFilename(); |
|
143 | + $files[ $i ][ 'filename' ] = $file->getFilename(); |
|
144 | 144 | $i++; |
145 | 145 | } |
146 | 146 | } |
147 | 147 | chdir(dirname(getcwd())); |
148 | 148 | $model = new JsonModel(); |
149 | - $model->setVariables(['files' => $files]); |
|
149 | + $model->setVariables([ 'files' => $files ]); |
|
150 | 150 | |
151 | 151 | return $model; |
152 | 152 | } |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | { |
161 | 161 | $adapter = new Http(); |
162 | 162 | |
163 | - $size = new Size(['min' => '10kB', 'max' => '5MB','useByteString' => true]); |
|
164 | - $extension = new Extension(['jpg','gif','png','jpeg','bmp','webp','svg'], true); |
|
163 | + $size = new Size([ 'min' => '10kB', 'max' => '5MB', 'useByteString' => true ]); |
|
164 | + $extension = new Extension([ 'jpg', 'gif', 'png', 'jpeg', 'bmp', 'webp', 'svg' ], true); |
|
165 | 165 | |
166 | 166 | if (extension_loaded('fileinfo')) { |
167 | - $adapter->setValidators([new IsImage()]); |
|
167 | + $adapter->setValidators([ new IsImage() ]); |
|
168 | 168 | } |
169 | 169 | |
170 | - $adapter->setValidators([$size, $extension]); |
|
170 | + $adapter->setValidators([ $size, $extension ]); |
|
171 | 171 | |
172 | 172 | $adapter->setDestination('public/userfiles/images/'); |
173 | 173 | |
@@ -181,20 +181,20 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function uploadFiles(Http $adapter) |
183 | 183 | { |
184 | - $uploadStatus = []; |
|
184 | + $uploadStatus = [ ]; |
|
185 | 185 | |
186 | 186 | foreach ($adapter->getFileInfo() as $key => $file) { |
187 | - if (!$adapter->isValid($file['name'])) { |
|
187 | + if (!$adapter->isValid($file[ 'name' ])) { |
|
188 | 188 | foreach ($adapter->getMessages() as $key => $msg) { |
189 | - $uploadStatus['errorFiles'][] = $file['name'].' '.strtolower($msg); |
|
189 | + $uploadStatus[ 'errorFiles' ][ ] = $file[ 'name' ].' '.strtolower($msg); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
193 | 193 | // @codeCoverageIgnoreStart |
194 | - if (!$adapter->receive($file['name'])) { |
|
195 | - $uploadStatus['errorFiles'][] = $file['name'].' was not uploaded'; |
|
194 | + if (!$adapter->receive($file[ 'name' ])) { |
|
195 | + $uploadStatus[ 'errorFiles' ][ ] = $file[ 'name' ].' was not uploaded'; |
|
196 | 196 | } else { |
197 | - $uploadStatus['successFiles'][] = $file['name'].' was successfully uploaded'; |
|
197 | + $uploadStatus[ 'successFiles' ][ ] = $file[ 'name' ].' was successfully uploaded'; |
|
198 | 198 | } |
199 | 199 | // @codeCoverageIgnoreEnd |
200 | 200 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | { |
66 | 66 | /* @var MvcEvent $e */ |
67 | 67 | $sharedManager = $e->getApplication()->getEventManager()->getSharedManager(); |
68 | - $sharedManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, [$this, 'initAuthtentication'], 100); |
|
68 | + $sharedManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, [ $this, 'initAuthtentication' ], 100); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function initAuthtentication(MvcEvent $e) |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | class BasicAuthenticationAdapterFactory implements FactoryInterface |
14 | 14 | { |
15 | 15 | /** @var array|object|string $basicConfig */ |
16 | - private $basicConfig = []; |
|
16 | + private $basicConfig = [ ]; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param array|object|string $basicConfig |
20 | 20 | */ |
21 | - public function __construct(array $basicConfig = []) |
|
21 | + public function __construct(array $basicConfig = [ ]) |
|
22 | 22 | { |
23 | 23 | $this->basicConfig = $basicConfig; |
24 | 24 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $this->basicConfig = $basicServiceLocator->get('Config'); |
33 | 33 | } |
34 | 34 | |
35 | - $authBasicConfig = $this->basicConfig['authentication_basic']['adapter']; |
|
36 | - $authBasicAdapter = new HttpAdapter($authBasicConfig['config']); |
|
35 | + $authBasicConfig = $this->basicConfig[ 'authentication_basic' ][ 'adapter' ]; |
|
36 | + $authBasicAdapter = new HttpAdapter($authBasicConfig[ 'config' ]); |
|
37 | 37 | |
38 | 38 | $basic = new FileResolver(); |
39 | - $basic->setFile($authBasicConfig['basic']); |
|
39 | + $basic->setFile($authBasicConfig[ 'basic' ]); |
|
40 | 40 | |
41 | 41 | $authBasicAdapter->setBasicResolver($basic); |
42 | 42 |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | class DigestAuthenticationAdapterFactory implements FactoryInterface |
11 | 11 | { |
12 | 12 | /** @var array|object|string $digestConfig */ |
13 | - private $digestConfig = []; |
|
13 | + private $digestConfig = [ ]; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param array|object|string $digestConfig |
17 | 17 | */ |
18 | - public function __construct(array $digestConfig = []) |
|
18 | + public function __construct(array $digestConfig = [ ]) |
|
19 | 19 | { |
20 | 20 | $this->digestConfig = $digestConfig; |
21 | 21 | } |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | $this->digestConfig = $digestServiceLocator->get('Config'); |
30 | 30 | } |
31 | 31 | |
32 | - $authDigestConfig = $this->digestConfig['authentication_digest']['adapter']; |
|
33 | - $authDigestAdapter = new HttpAdapter($authDigestConfig['config']); |
|
32 | + $authDigestConfig = $this->digestConfig[ 'authentication_digest' ][ 'adapter' ]; |
|
33 | + $authDigestAdapter = new HttpAdapter($authDigestConfig[ 'config' ]); |
|
34 | 34 | |
35 | 35 | $digest = new FileResolver(); |
36 | - $digest->setFile($authDigestConfig['digest']); |
|
36 | + $digest->setFile($authDigestConfig[ 'digest' ]); |
|
37 | 37 | |
38 | 38 | $authDigestAdapter->setDigestResolver($digest); |
39 | 39 |
@@ -47,14 +47,14 @@ |
||
47 | 47 | $request = $this->getRequest(); |
48 | 48 | |
49 | 49 | //default value without post parameter |
50 | - $barcodeOptions = ['text' => '123456789']; |
|
50 | + $barcodeOptions = [ 'text' => '123456789' ]; |
|
51 | 51 | $barcode = Barcode::factory('codabar', 'image', $barcodeOptions); |
52 | 52 | |
53 | 53 | if ($request->isPost()) { |
54 | 54 | $this->form->setData($request->getPost()); |
55 | 55 | if ($this->form->isValid()) { |
56 | - $barcodeOptions = ['text' => $this->form->getData()['barcode-object-text']]; |
|
57 | - $barcode = Barcode::factory($this->form->getData()['barcode-object-select'], 'image', $barcodeOptions); |
|
56 | + $barcodeOptions = [ 'text' => $this->form->getData()[ 'barcode-object-text' ] ]; |
|
57 | + $barcode = Barcode::factory($this->form->getData()[ 'barcode-object-select' ], 'image', $barcodeOptions); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | public function createService(ServiceLocatorInterface $sl) |
32 | 32 | { |
33 | 33 | $form = new BarcodeForm( |
34 | - $sl->getServiceLocator()->get('BarcodeObjectPluginManager')->getRegisteredServices()['invokableClasses'] |
|
34 | + $sl->getServiceLocator()->get('BarcodeObjectPluginManager')->getRegisteredServices()[ 'invokableClasses' ] |
|
35 | 35 | ); |
36 | 36 | |
37 | 37 | return $form; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'type' => 'Zend\Form\Element\Text', |
60 | 60 | 'name' => 'barcode-object-text', |
61 | 61 | 'options' => [ |
62 | - 'value_options' => [], |
|
62 | + 'value_options' => [ ], |
|
63 | 63 | ], |
64 | 64 | 'attributes' => [ |
65 | 65 | 'value' => '123456789', |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | 'name' => 'barcode-object-text', |
104 | 104 | 'required' => true, |
105 | 105 | 'filters' => [ |
106 | - ['name' => 'StripTags'], |
|
107 | - ['name' => 'StringTrim'], |
|
106 | + [ 'name' => 'StripTags' ], |
|
107 | + [ 'name' => 'StringTrim' ], |
|
108 | 108 | ], |
109 | 109 | 'validators' => [ |
110 | 110 | [ |
@@ -38,9 +38,9 @@ |
||
38 | 38 | $services = $serviceLocator->getServiceLocator(); |
39 | 39 | $config = $services->get('Config'); |
40 | 40 | $captchaAdapterKey = $services->get('Application') |
41 | - ->getMvcEvent() |
|
42 | - ->getRequest() |
|
43 | - ->getQuery('captcha_adapter', 0); |
|
41 | + ->getMvcEvent() |
|
42 | + ->getRequest() |
|
43 | + ->getQuery('captcha_adapter', 0); |
|
44 | 44 | |
45 | 45 | $form = new CaptchaForm($config['learnzf2_captcha_config'], $captchaAdapterKey); |
46 | 46 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | ->getRequest() |
43 | 43 | ->getQuery('captcha_adapter', 0); |
44 | 44 | |
45 | - $form = new CaptchaForm($config['learnzf2_captcha_config'], $captchaAdapterKey); |
|
45 | + $form = new CaptchaForm($config[ 'learnzf2_captcha_config' ], $captchaAdapterKey); |
|
46 | 46 | |
47 | 47 | return $form; |
48 | 48 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | */ |
56 | 56 | private function collectValueOptions() |
57 | 57 | { |
58 | - $options = []; |
|
58 | + $options = [ ]; |
|
59 | 59 | foreach ($this->captchaConfig as $key => $config) { |
60 | - $options[$key] = $config['adapter_name']; |
|
60 | + $options[ $key ] = $config[ 'adapter_name' ]; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $options; |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | 'type' => 'Zend\Form\Element\Captcha', |
89 | 89 | 'name' => 'captcha', |
90 | 90 | 'options' => [ |
91 | - 'label' => $this->captchaConfig[$this->captchaAdapterKey]['options']['label'], |
|
91 | + 'label' => $this->captchaConfig[ $this->captchaAdapterKey ][ 'options' ][ 'label' ], |
|
92 | 92 | 'captcha' => [ |
93 | - 'class' => $this->collectValueOptions()[$this->captchaAdapterKey], |
|
94 | - 'options' => $this->captchaConfig[$this->captchaAdapterKey]['options'], |
|
93 | + 'class' => $this->collectValueOptions()[ $this->captchaAdapterKey ], |
|
94 | + 'options' => $this->captchaConfig[ $this->captchaAdapterKey ][ 'options' ], |
|
95 | 95 | ], |
96 | 96 | ], |
97 | 97 | ]); |