Completed
Push — master ( ed55c8...f3d89b )
by Vojta
02:05
created
components/Letters.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function onRun()
32 32
     {
33
-        $this->page['characters'] = $this->characters = $this->getBrandCharacters();
33
+        $this->page[ 'characters' ] = $this->characters = $this->getBrandCharacters();
34 34
     }
35 35
 
36 36
     /**
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
     public function getBrandCharacters()
42 42
     {
43 43
         // get unique letters
44
-        $letters = [];
44
+        $letters = [ ];
45 45
         Model::all()->each(function($brand) use (&$letters)
46 46
         {
47 47
             // get letter
48 48
             $letter = mb_strtolower(mb_substr($brand->name, 0, 1));
49 49
 
50 50
             // init array when doesn't exists
51
-            if (!isset($letters[$letter])) {
52
-                $letters[$letter] = [
51
+            if (!isset($letters[ $letter ])) {
52
+                $letters[ $letter ] = [
53 53
                     'name' => $letter,
54 54
                     'count' => 0,
55 55
                     'url' => $this->controller->pageUrl($this->property('brandsPage'), [
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
                     ]),
58 58
                 ];
59 59
             }
60
-            $letters[$letter]['count']++;
60
+            $letters[ $letter ][ 'count' ]++;
61 61
         });
62 62
 
63 63
         // sort them
64 64
         usort($letters, function($a, $b) {
65
-            if ($a['name'] == $b['name']) {
65
+            if ($a[ 'name' ] == $b[ 'name' ]) {
66 66
                 return 0;
67 67
             }
68 68
 
69
-            return $a['name'] > $b['name'] ? 1 : -1;
69
+            return $a[ 'name' ] > $b[ 'name' ] ? 1 : -1;
70 70
         });
71 71
 
72 72
         return $letters;
Please login to merge, or discard this patch.