@@ -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 | ]); |
@@ -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()) { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | /* @var MvcEvent $e */ |
69 | 69 | $sharedManager = $e->getApplication()->getEventManager()->getSharedManager(); |
70 | - $sharedManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, [$this, 'initCurrentLocale'], 10); |
|
70 | + $sharedManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, [ $this, 'initCurrentLocale' ], 10); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | public function initCurrentLocale(MvcEvent $e) |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | $logContent = ''; |
72 | 72 | |
73 | 73 | // initialize when no submit anymore |
74 | - $data = []; |
|
75 | - $data['logmessage'] = $this->form->get('logmessage')->getValue(); |
|
74 | + $data = [ ]; |
|
75 | + $data[ 'logmessage' ] = $this->form->get('logmessage')->getValue(); |
|
76 | 76 | if ($request->isPost()) { |
77 | 77 | $this->form->setData($request->getPost()); |
78 | 78 | if ($this->form->isValid()) { |
79 | 79 | $data = $this->form->getData(); |
80 | 80 | |
81 | - $this->loggerPriority = $data['logpriority']; |
|
82 | - if ($data['logformat'] !== 'simple') { |
|
83 | - $this->loggerConfig['writers'][0]['options']['formatter']['name'] = $data['logformat']; |
|
84 | - unset($this->loggerConfig['writers'][0]['options']['formatter']['options']); |
|
81 | + $this->loggerPriority = $data[ 'logpriority' ]; |
|
82 | + if ($data[ 'logformat' ] !== 'simple') { |
|
83 | + $this->loggerConfig[ 'writers' ][ 0 ][ 'options' ][ 'formatter' ][ 'name' ] = $data[ 'logformat' ]; |
|
84 | + unset($this->loggerConfig[ 'writers' ][ 0 ][ 'options' ][ 'formatter' ][ 'options' ]); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | // save log data to buffer and make it variable |
92 | 92 | ob_start(); |
93 | - $logger->log((int) $this->loggerPriority, $data['logmessage']); |
|
93 | + $logger->log((int) $this->loggerPriority, $data[ 'logmessage' ]); |
|
94 | 94 | $logContent = ob_get_clean(); |
95 | 95 | |
96 | 96 | return new ViewModel([ |