Passed
Push — master ( dde27b...d8aae6 )
by Andrey
01:44
created
src/MenuWidget.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function run()
89 89
     {
90
-        if (null === $this->dataProvider){
90
+        if (null === $this->dataProvider) {
91 91
             throw  new InvalidConfigException('Parameter dataProvider is not defined.');
92 92
         }
93 93
 
94
-        if (null === $this->itemTemplate || !is_string($this->itemTemplate)){
94
+        if (null === $this->itemTemplate || !is_string($this->itemTemplate)) {
95 95
             throw  new InvalidConfigException('Item template is not defined.');
96 96
         }
97 97
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     private function groupLevels(array $models): array
120 120
     {
121
-        if (count($models) == 0){
121
+        if (count($models) == 0) {
122 122
             return [];
123 123
         }
124 124
 
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
 
127 127
         /** @var ActiveRecord $item */
128 128
         $modelsCount = count($models);
129
-        for ($i=0; $i < $modelsCount; $i++) {
129
+        for ($i = 0; $i < $modelsCount; $i++) {
130 130
             $item = $models[$i];
131 131
             $items[$item->{$this->primaryKeyName}]['data'] = $item;
132 132
         }
133 133
 
134 134
         /** @var ActiveRecord $data */
135
-        foreach($items as $row) {
135
+        foreach ($items as $row) {
136 136
             $data = $row['data'];
137 137
             $parentKey = !isset($data->{$this->parentKeyName}) || empty($data->{$this->parentKeyName}) ? 0 : $data->{$this->parentKeyName};
138 138
             $items[$parentKey]['items'][$data->{$this->primaryKeyName}] = &$items[$data->{$this->primaryKeyName}];
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     private function renderItems(array $items): string
150 150
     {
151
-        if (count($items) == 0){
151
+        if (count($items) == 0) {
152 152
             return '';
153 153
         }
154 154
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 'data' => $item['data']
161 161
             ], $this->itemTemplateParams));
162 162
 
163
-            if (isset($item['items'])){
163
+            if (isset($item['items'])) {
164 164
                 $contentLi .= $this->renderItems($item['items']);
165 165
             }
166 166
             $outPut .= Html::tag($this->itemContainerTag, $contentLi, $this->itemContainerOptions);
Please login to merge, or discard this patch.