@@ -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 | [ |
@@ -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 | ]); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | public function indexAction() |
| 44 | 44 | { |
| 45 | 45 | $request = $this->getRequest(); |
| 46 | - $formMessages = []; |
|
| 46 | + $formMessages = [ ]; |
|
| 47 | 47 | $isPost = false; |
| 48 | 48 | |
| 49 | 49 | if ($request->isPost()) { |
@@ -153,15 +153,15 @@ discard block |
||
| 153 | 153 | 'required' => false, |
| 154 | 154 | 'allow_empty' => true, |
| 155 | 155 | 'filters' => [ |
| 156 | - ['name' => 'Int'], |
|
| 156 | + [ 'name' => 'Int' ], |
|
| 157 | 157 | ], |
| 158 | 158 | ], |
| 159 | 159 | [ |
| 160 | 160 | 'name' => 'name', |
| 161 | 161 | 'required' => true, |
| 162 | 162 | 'filters' => [ |
| 163 | - ['name' => 'StripTags'], |
|
| 164 | - ['name' => 'StringTrim'], |
|
| 163 | + [ 'name' => 'StripTags' ], |
|
| 164 | + [ 'name' => 'StringTrim' ], |
|
| 165 | 165 | ], |
| 166 | 166 | 'validators' => [ |
| 167 | 167 | [ |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | [ |
| 181 | 181 | 'name' => 'InArray', |
| 182 | 182 | 'options' => [ |
| 183 | - 'haystack' => [2,3], |
|
| 183 | + 'haystack' => [ 2, 3 ], |
|
| 184 | 184 | 'messages' => [ |
| 185 | 185 | 'notInArray' => 'Please select your gender !', |
| 186 | 186 | ], |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | 'name' => 'address', |
| 217 | 217 | 'required' => true, |
| 218 | 218 | 'filters' => [ |
| 219 | - ['name' => 'StripTags'], |
|
| 220 | - ['name' => 'StringTrim'], |
|
| 219 | + [ 'name' => 'StripTags' ], |
|
| 220 | + [ 'name' => 'StringTrim' ], |
|
| 221 | 221 | ], |
| 222 | 222 | 'validators' => [ |
| 223 | 223 | [ |