Completed
Pull Request — master (#51)
by De Cramer
02:42
created
src/eXpansion/Framework/Core/Helpers/Data/ArrayFilter.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@
 block discarded – undo
58 58
     /**
59 59
      * Check if value respects condition.
60 60
      *
61
-     * @param $value
61
+     * @param string $value
62 62
      * @param $condition
63 63
      *
64
-     * @return bool
64
+     * @return boolean|null
65 65
      * @throws InvalidFilterTypeException
66 66
      */
67 67
     protected function checkValue($value, $condition) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
                     $allTrue = true;
41 41
                     break;
42 42
                 } else if ($logic == self::FILTER_LOGIC_AND) {
43
-                    if (!$result)  {
43
+                    if (!$result) {
44 44
                         $allTrue = false;
45 45
                         break;
46 46
                     }
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Factory/LineFactory.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     /**
46 46
      * TODO Handle more options such as pregenerated buttons and such instead of text.
47 47
      *
48
-     * @param $totalWidth
48
+     * @param double $totalWidth
49 49
      * @param $columns
50 50
      *
51 51
      * @return Frame
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use FML\Controls\Control;
5 5
 use FML\Controls\Frame;
6 6
 use FML\Controls\Label;
7
-use FML\Types\Renderable;
8 7
 use oliverde8\AssociativeArraySimplified\AssociativeArray;
9 8
 
10 9
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     public function create($totalWidth, $columns, $index = 0)
54 54
     {
55 55
         $totalCoef
56
-            = ($totalWidth - 1) / array_reduce($columns, function($carry, $item){return $carry + $item['width'];});
56
+            = ($totalWidth - 1) / array_reduce($columns, function($carry, $item) {return $carry + $item['width']; });
57 57
 
58 58
         $frame = new Frame();
59 59
         $frame->setHeight(5);
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Grid/DataCollection.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param mixed  $lineData
65 65
      * @param string $key
66 66
      *
67
-     * @return mixed
67
+     * @return string
68 68
      */
69 69
     public function getLineData($lineData, $key)
70 70
     {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * Get the number of the last page.
76 76
      *
77
-     * @return int
77
+     * @return double
78 78
      */
79 79
     public function getLastPageNumber()
80 80
     {
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Grid/DataCollectionInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      * @param mixed  $lineData
26 26
      * @param string $key
27 27
      *
28
-     * @return mixed
28
+     * @return string
29 29
      */
30 30
     public function getLineData($lineData, $key);
31 31
 
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Grid/GridBuilder.php 3 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace eXpansion\Framework\Core\Model\Gui\Grid;
4 4
 use eXpansion\Framework\Core\Model\Gui\Action;
5
-use eXpansion\Framework\Core\Model\Gui\Factory\LabelFactory;
6 5
 use eXpansion\Framework\Core\Model\Gui\Factory\LineFactory;
7 6
 use eXpansion\Framework\Core\Model\Gui\Factory\PagerFactory;
8 7
 use eXpansion\Framework\Core\Model\Gui\Grid\Column\AbstractColumn;
@@ -12,8 +11,6 @@  discard block
 block discarded – undo
12 11
 use eXpansion\Framework\Core\Plugins\Gui\ActionFactory;
13 12
 use eXpansion\Framework\Core\Plugins\Gui\ManialinkFactory;
14 13
 use FML\Controls\Frame;
15
-use FML\Controls\Label;
16
-use FML\Controls\Quads\Quad_Icons64x64_1;
17 14
 
18 15
 
19 16
 /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $this->lineFactory = $lineFactory;
91 91
         $this->pagerFactory = $pagerFactory;
92 92
 
93
-        $this->pageKey = spl_object_hash($this) . "_key";
93
+        $this->pageKey = spl_object_hash($this)."_key";
94 94
     }
95 95
 
96 96
     /**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $lineHeight = 5 + 0.5;
193 193
 
194 194
         $frame = new Frame();
195
-        $frame->setPosition(0,0);
195
+        $frame->setPosition(0, 0);
196 196
         $frame->setSize($width, $height);
197 197
 
198 198
         $posY = 0;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                         'width' => $columnData->getWidthCoeficiency(),
222 222
                         'translatable' => $columnData->getTranslatable()
223 223
                     ];
224
-                } elseif($columnData instanceof ActionColumn) {
224
+                } elseif ($columnData instanceof ActionColumn) {
225 225
                     $action = $this->actionFactory
226 226
                         ->createManialinkAction($this->manialink, $columnData->getCallable(), $lineData);
227 227
                     $this->temporaryActions[] = $action;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         /*
242 242
          * Handle the pager.
243 243
          */
244
-        $posY = ($frame->getHeight() -7) * -1;
244
+        $posY = ($frame->getHeight() - 7) * -1;
245 245
         $pager = $this->pagerFactory->create(
246 246
             $frame->getWidth(),
247 247
             $this->currentPage,
Please login to merge, or discard this patch.
Doc Comments   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
     }
146 146
 
147 147
     /**
148
-     * @param      $key
149
-     * @param      $name
150
-     * @param      $widthCoefficiency
148
+     * @param      string $key
149
+     * @param      string $name
150
+     * @param      integer $widthCoefficiency
151 151
      * @param bool $sortable
152 152
      * @param bool $translatable
153 153
      *
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
     /**
164 164
      * Add an action into a column.
165 165
      *
166
-     * @param $key
167
-     * @param $name
168
-     * @param $widthCoefficiency
166
+     * @param string $key
167
+     * @param string $name
168
+     * @param integer $widthCoefficiency
169 169
      * @param $action
170
-     * @param $renderer
170
+     * @param Label $renderer
171 171
      */
172 172
     public function addActionColumn($key, $name, $widthCoefficiency, $action, $renderer)
173 173
     {
@@ -183,6 +183,10 @@  discard block
 block discarded – undo
183 183
         $this->totalWidthCoefficency = 0;
184 184
     }
185 185
 
186
+    /**
187
+     * @param double $width
188
+     * @param double $height
189
+     */
186 190
     public function build($width, $height)
187 191
     {
188 192
         foreach ($this->temporaryActions as $action) {
@@ -296,7 +300,7 @@  discard block
 block discarded – undo
296 300
     /**
297 301
      * Handle page change & refresh user window.
298 302
      *
299
-     * @param $page
303
+     * @param integer $page
300 304
      */
301 305
     protected function changePage($page)
302 306
     {
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Plugins/Gui/ManialinkFactory.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -116,6 +116,7 @@
 block discarded – undo
116 116
 
117 117
     /**
118 118
      * @inheritdoc
119
+     * @param Group $group
119 120
      */
120 121
     final public function update($group)
121 122
     {
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Factory/PagerFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $actionPreviousPage,
46 46
         $actionNextPage,
47 47
         $actionLastPage
48
-    ){
48
+    ) {
49 49
         $frame = new Frame();
50 50
         $frame->setSize($width, 7);
51 51
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         if ($currentPageNumber > 2) {
56 56
             $button = Quad_Icons64x64_1::create();
57 57
             $button->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowFirst)
58
-                ->setSize($buttonSize,$buttonSize)
58
+                ->setSize($buttonSize, $buttonSize)
59 59
                 ->setPosition(1, 0)
60 60
                 ->setAction($actionFirstPage);
61 61
             $frame->addChild($button);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         if ($currentPageNumber > 1) {
64 64
             $button = Quad_Icons64x64_1::create();
65 65
             $button->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowPrev)
66
-                ->setSize($buttonSize,$buttonSize)
66
+                ->setSize($buttonSize, $buttonSize)
67 67
                 ->setPosition(2 + $buttonSize, 0)
68 68
                 ->setAction($actionPreviousPage);
69 69
             $frame->addChild($button);
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
         if ($currentPageNumber < $lastPageNumber) {
80 80
             $button = Quad_Icons64x64_1::create();
81 81
             $button->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowNext)
82
-                ->setSize($buttonSize,$buttonSize)
83
-                ->setPosition($frame->getWidth() - 1 - (2*$buttonSize), 0)
82
+                ->setSize($buttonSize, $buttonSize)
83
+                ->setPosition($frame->getWidth() - 1 - (2 * $buttonSize), 0)
84 84
                 ->setAction($actionNextPage);
85 85
             $frame->addChild($button);
86 86
         }
87 87
         if ($currentPageNumber < $lastPageNumber - 1) {
88 88
             $button = Quad_Icons64x64_1::create();
89 89
             $button->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_ArrowLast)
90
-                ->setSize($buttonSize,$buttonSize)
90
+                ->setSize($buttonSize, $buttonSize)
91 91
                 ->setPosition($frame->getWidth() - 1 - $buttonSize, 0)
92 92
                 ->setAction($actionLastPage);
93 93
             $frame->addChild($button);
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Plugins/Gui/WindowHelpFactory.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use eXpansion\Framework\Core\Services\ChatCommands;
11 11
 use FML\Controls\Frame;
12 12
 use FML\Controls\Label;
13
-use FML\Controls\Quads\Quad_Icons64x64_1;
14 13
 
15 14
 
16 15
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,6 +113,6 @@
 block discarded – undo
113 113
      */
114 114
     public function callbackHelp($login, $params, $arguments)
115 115
     {
116
-        $this->chatCommandDataPovider->onPlayerChat(0, $login, '/' . $arguments['command'] . ' -h', true);
116
+        $this->chatCommandDataPovider->onPlayerChat(0, $login, '/'.$arguments['command'].' -h', true);
117 117
     }
118 118
 }
Please login to merge, or discard this patch.
src/eXpansion/Framework/Core/Model/Gui/Window.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     /**
176 176
      * Recursive search all dome tree in order to find all translatable labels.
177 177
      *
178
-     * @param $frame
178
+     * @param \FML\ManiaLink $frame
179 179
      * @param $translations
180 180
      */
181 181
     protected function getDictionaryInformation($frame, &$translations)
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      *
306 306
      * @param Format $format New Format
307 307
      *
308
-     * @return static
308
+     * @return Frame
309 309
      * @deprecated Use Style
310 310
      * @see        Style
311 311
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
         foreach ($translations as $msgId => $messages) {
169 169
             foreach ($messages as $message) {
170
-                $this->dictionary->setEntry($message['Lang'], $msgId, htmlspecialchars ($message['Text']));
170
+                $this->dictionary->setEntry($message['Lang'], $msgId, htmlspecialchars($message['Text']));
171 171
             }
172 172
         }
173 173
     }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         foreach ($frame->getChildren() as $child) {
184 184
             if ($child instanceof Label && $child->getTranslate()) {
185
-                $textId = 'exp_' . md5($child->getTextId());
185
+                $textId = 'exp_'.md5($child->getTextId());
186 186
                 $translations[$textId] = $this->translationHelper->getTranslations($child->getTextId(), []);
187 187
 
188 188
                 // Replaces with text id that can be used in the xml.
Please login to merge, or discard this patch.