@@ -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()) { |
@@ -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([ |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $paginator->setCurrentPageNumber($page) |
31 | 31 | ->setItemCountPerPage(self::ITEM_PER_PAGE); |
32 | 32 | |
33 | - return new ViewModel(array_merge($this->params()->fromQuery(), ['paginator' => $paginator])); |
|
33 | + return new ViewModel(array_merge($this->params()->fromQuery(), [ 'paginator' => $paginator ])); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | { |
41 | 41 | // Filter by category |
42 | 42 | $category = $this->params()->fromQuery('category', ''); |
43 | - $data = array_key_exists($category, $this->data) ? $this->data[$category] : array_merge( |
|
44 | - $this->data['movies'], |
|
45 | - $this->data['books'], |
|
46 | - $this->data['music'] |
|
43 | + $data = array_key_exists($category, $this->data) ? $this->data[ $category ] : array_merge( |
|
44 | + $this->data[ 'movies' ], |
|
45 | + $this->data[ 'books' ], |
|
46 | + $this->data[ 'music' ] |
|
47 | 47 | ); |
48 | 48 | |
49 | 49 | // Filter by keyword |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | // Remove those elements which doesn't accomplish the keyword condition |
56 | 56 | foreach ($data as $key => $element) { |
57 | - if (!$this->isKeywordInTitle($keyword, $element['title'])) { |
|
58 | - unset($data[$key]); |
|
57 | + if (!$this->isKeywordInTitle($keyword, $element[ 'title' ])) { |
|
58 | + unset($data[ $key ]); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 |