Completed
Push — develop ( b70998...1e3443 )
by
unknown
04:08
created
src/AbstractGridManagerFactory.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      * @param GridPluginManager | ServiceLocatorInterface $serviceLocator
115 115
      * @param $name
116 116
      * @param $requestedName
117
-     * @return mixed
117
+     * @return GridInterface
118 118
      * @throws Exception\RuntimeException
119 119
      */
120 120
     public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     /**
182 182
      * @param $navigationBarOptions
183 183
      * @param ServiceLocatorInterface $serviceManager
184
-     * @return NavigationBarInterface|null
184
+     * @return NavigationBarInterface
185 185
      * @throws NavigationBar\Exception\InvalidArgumentException
186 186
      * @throws NavigationBar\Exception\NavigationBarNotFoundException
187 187
      * @throws NavigationBar\Exception\RuntimeException
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
38 38
     {
39 39
         $res = false;
40
-        if (strpos($requestedName, static::CONFIG_KEY . '.') === 0) {
40
+        if (strpos($requestedName, static::CONFIG_KEY.'.') === 0) {
41 41
             $res = true;
42 42
         }
43 43
         return $res;
@@ -129,17 +129,17 @@  discard block
 block discarded – undo
129 129
         if ($gridsConfig === null || count($gridsConfig) === 0) {
130 130
             throw new Exception\RuntimeException('В конфигурационном файле нет секции grids');
131 131
         }
132
-        $gridName = substr($requestedName, strlen(self::CONFIG_KEY . '.'));
132
+        $gridName = substr($requestedName, strlen(self::CONFIG_KEY.'.'));
133 133
         if (!array_key_exists($gridName, $gridsConfig) || !$gridsConfig[$gridName]) {
134 134
             throw new Exception\RuntimeException(
135 135
                 sprintf('Таблица с именем %s не найдена в конфиге гридов.', $gridName)
136 136
             );
137 137
         }
138
-        $gridConfig =& $gridsConfig[$gridName];
138
+        $gridConfig = & $gridsConfig[$gridName];
139 139
         if (!array_key_exists('class', $gridConfig) || !$gridConfig['class']) {
140 140
             throw new Exception\RuntimeException('Необходимо задать класс таблицы в конфиге.');
141 141
         }
142
-        $gridClass =& $gridConfig['class'];
142
+        $gridClass = & $gridConfig['class'];
143 143
         $options = [];
144 144
         if (array_key_exists('options', $gridConfig) && $gridConfig['options']) {
145 145
             if (!is_array($gridConfig['options']) && !$gridConfig['options'] instanceof ArrayAccess) {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             /** @var \ZF\ContentNegotiation\Request $request */
169 169
             $request = $serviceManager->get('request');
170 170
             $cookie = $request->getCookie();
171
-            $name = !empty($gridConfig['options']['name'])? $gridConfig['options']['name'] : $gridName;
171
+            $name = !empty($gridConfig['options']['name']) ? $gridConfig['options']['name'] : $gridName;
172 172
             if (!empty($cookie['nnx']['grid'][$name])
173 173
                 && is_string($cookie['nnx']['grid'][$name])
174 174
                 && $userHideColums = json_decode($cookie['nnx']['grid'][$name], true)) {
Please login to merge, or discard this patch.
src/Button/Factory.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,6 @@
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * Создает экземпляр класса фабрики
53
-     * @param array|Traversable $spec
54 53
      * @throws InvalidButtonException
55 54
      * @throws InvalidNameException
56 55
      * @throws InValidSpecificationException
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         if (array_key_exists('options', $spec) && $spec['options']) {
58 58
             $options = $spec['options'];
59 59
         }
60
-        $className = __NAMESPACE__ . '\\' . ucfirst($spec['type']);
60
+        $className = __NAMESPACE__.'\\'.ucfirst($spec['type']);
61 61
         $reflectionClass = new ReflectionClass($className);
62 62
         if (!$reflectionClass->isInstantiable()) {
63 63
             throw new Exception\RuntimeException(
Please login to merge, or discard this patch.
src/View/Helper/JqGrid/Grid.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
     /**
118 118
      * @param string $key
119 119
      * @param array $options
120
-     * @param mixed $default
120
+     * @param string $default
121 121
      * @return null|string|array
122 122
      */
123 123
     protected function getConfigVal($key, array $options, $default = null)
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
         $escape = $view->plugin('escapeHtml');
39 39
         $bottomNavigationBar = $this->renderNavigationBar($grid->getBottomNavigationBar());
40 40
         $topNavigationBar = $this->renderNavigationBar($grid->getTopNavigationBar());
41
-        $res = $topNavigationBar['html'] . '<table id="grid-' . $escape($grid->getName()) . '"></table>' . $bottomNavigationBar['html'];
42
-        $buttonsJs = $topNavigationBar['js'] . $bottomNavigationBar['js'];
41
+        $res = $topNavigationBar['html'].'<table id="grid-'.$escape($grid->getName()).'"></table>'.$bottomNavigationBar['html'];
42
+        $buttonsJs = $topNavigationBar['js'].$bottomNavigationBar['js'];
43 43
         /** @var PhpRenderer $view */
44 44
         $view = $this->getView();
45 45
         $config = $this->getGridConfig($grid);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             $columnClass = get_class($column);
48 48
             $columnPath = explode('\\', $columnClass);
49 49
             $colName = array_pop($columnPath);
50
-            $helperName = 'nnxGridJqGrid' . $colName;
50
+            $helperName = 'nnxGridJqGrid'.$colName;
51 51
             /** @var string $columnsJqOptions */
52 52
             $config['colModel'][] = $view->$helperName($column);
53 53
         }
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
             foreach ($mutators as $mutator) {
58 58
                 if ($mutator instanceof HighlightMutatorInterface) {
59 59
                     $config['rowattr'] = '%rowAttrFunction%';
60
-                    $rowAttr = 'function(rd) {' .
61
-                        'if(rd.' . $mutator->getDataName() . ') {'
62
-                        . 'return {"class": rd.' . $mutator->getDataName() . '};'
60
+                    $rowAttr = 'function(rd) {'.
61
+                        'if(rd.'.$mutator->getDataName().') {'
62
+                        . 'return {"class": rd.'.$mutator->getDataName().'};'
63 63
                         . '}'
64 64
                         . '}';
65 65
                 }
66 66
             }
67 67
         }
68 68
         $view->headScript()->appendScript('$(function(){'
69
-            . 'var grid = $("#grid-' . $grid->getName() . '").jqGrid('
70
-            . str_replace('"%rowAttrFunction%"', $rowAttr, json_encode((object)$config)) . ');'
71
-            . str_replace('%gridName%', $grid->getName(), $buttonsJs) .'});');
69
+            . 'var grid = $("#grid-'.$grid->getName().'").jqGrid('
70
+            . str_replace('"%rowAttrFunction%"', $rowAttr, json_encode((object)$config)).');'
71
+            . str_replace('%gridName%', $grid->getName(), $buttonsJs).'});');
72 72
         return $res;
73 73
     }
74 74
 
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
             /** @var ButtonInterface $button */
87 87
             foreach ($navigationBar->getButtons() as $button) {
88 88
                 $buttonResult = $view->nnxGridJqGridButton($button);
89
-                $html .=  $buttonResult['html'];
90
-                $js .=  $buttonResult['js'];
89
+                $html .= $buttonResult['html'];
90
+                $js .= $buttonResult['js'];
91 91
             }
92 92
             $html = "<div class='buttons-panel'>$html</div><br>";
93 93
         }
94
-        return ['html' => $html,'js' => $js];
94
+        return ['html' => $html, 'js' => $js];
95 95
     }
96 96
 
97 97
     /**
Please login to merge, or discard this patch.
src/Button/ExpandAll.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  */
15 15
 class ExpandAll extends Simple
16 16
 {
17
-    protected $name ='expandall';
17
+    protected $name = 'expandall';
18 18
 
19 19
     protected $title = 'Развернуть все';
20 20
 
Please login to merge, or discard this patch.
src/Button/ShowHideColumns.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  */
15 15
 class ShowHideColumns extends Simple
16 16
 {
17
-    protected $name ='showhidecolums';
17
+    protected $name = 'showhidecolums';
18 18
 
19 19
     protected $title = 'Столбцы';
20 20
 
Please login to merge, or discard this patch.
src/Button/CollapseAll.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  */
15 15
 class CollapseAll extends Simple
16 16
 {
17
-    protected $name ='collapseall';
17
+    protected $name = 'collapseall';
18 18
 
19 19
     protected $title = 'Свернуть все';
20 20
 
Please login to merge, or discard this patch.
src/NavigationBar/Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@
 block discarded – undo
40 40
             );
41 41
         }
42 42
         if (array_key_exists('type', $spec) && $spec['type']) {
43
-            $spec['class'] = __NAMESPACE__ . '\\' . ucfirst($spec['type']);
43
+            $spec['class'] = __NAMESPACE__.'\\'.ucfirst($spec['type']);
44 44
         }
45 45
 
46 46
         if (!array_key_exists('class', $spec) || !$spec['class']) {
47 47
             throw new Exception\RuntimeException('Секция навигационного бара существует, но не задан класс');
48 48
         }
49
-        $navigationBarClass =& $spec['class'];
49
+        $navigationBarClass = & $spec['class'];
50 50
         if (!class_exists($navigationBarClass)) {
51 51
             throw new Exception\NavigationBarNotFoundException(sprintf('NavigationBar %s не найден.', $navigationBarClass));
52 52
         }
Please login to merge, or discard this patch.
src/View/Helper/JqGrid/GridButton.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $title = $escape($button->getTitle());
32 32
         $html = "<a href='$url' $attributeString>$title</a> ";
33 33
         $js = $button->getJs();
34
-        return ['html' => $html,'js' => $js];
34
+        return ['html' => $html, 'js' => $js];
35 35
     }
36 36
 
37 37
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $escape = $view->plugin('escapeHtml');
46 46
         $res = '';
47 47
         foreach ($attributes as $name=>$value) {
48
-            $res .= $escape($name) . '="'.$escape($value).'" ';
48
+            $res .= $escape($name).'="'.$escape($value).'" ';
49 49
         }
50 50
         return $res;
51 51
     }
Please login to merge, or discard this patch.