Completed
Push — master ( a96253...c20805 )
by Nikolas
02:38
created
src/delivery/cli/renderers/tables/TableRenderer.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     /**
27 27
      * @param Table $value
28
-     * @return mixed
28
+     * @return string
29 29
      */
30 30
     public function render($value) {
31 31
         $climate = new CLImate();
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
     /**
78 78
      * @param Table $table
79
-     * @return mixed
79
+     * @return string[]
80 80
      */
81 81
     protected function getHeaders($table) {
82 82
         return $table->getHeaders();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         /** @var \League\CLImate\Util\Writer\Buffer $buffer */
42 42
         $buffer = $climate->output->get('buffer');
43 43
 
44
-        return PHP_EOL . $buffer->get();
44
+        return PHP_EOL.$buffer->get();
45 45
     }
46 46
 
47 47
     /**
Please login to merge, or discard this patch.
src/delivery/web/fields/FileField.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 
106 106
     /**
107 107
      * @param Parameter $parameter
108
-     * @return array|Element[]
108
+     * @return Element[]
109 109
      */
110 110
     public function headElements(Parameter $parameter) {
111 111
         return [
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                         new Element("input", array_merge([
61 61
                             'class' => 'sr-only file-input',
62 62
                             'type' => 'file',
63
-                            'name' => $parameter->getName() . '[file]'
63
+                            'name' => $parameter->getName().'[file]'
64 64
                         ], $parameter->isRequired() && is_null($value) ? [
65 65
                             'required' => 'required'
66 66
                         ] : []))
@@ -84,17 +84,17 @@  discard block
 block discarded – undo
84 84
         return (string)new Element('p', [], [
85 85
             new Element('input', [
86 86
                 'type' => 'hidden',
87
-                'name' => $parameter->getName() . '[name]',
87
+                'name' => $parameter->getName().'[name]',
88 88
                 'value' => $file->getName()
89 89
             ]),
90 90
             new Element('input', [
91 91
                 'type' => 'hidden',
92
-                'name' => $parameter->getName() . '[type]',
92
+                'name' => $parameter->getName().'[type]',
93 93
                 'value' => $file->getType()
94 94
             ]),
95 95
             new Element('input', [
96 96
                 'type' => 'hidden',
97
-                'name' => $parameter->getName() . '[data]',
97
+                'name' => $parameter->getName().'[data]',
98 98
                 'value' => base64_encode($file->getContent())
99 99
             ]),
100 100
             (new FileRenderer())->render($file)
Please login to merge, or discard this patch.
src/delivery/web/fields/ImageField.php 2 patches
Doc Comments   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
     /**
39
-     * @return array|int[]
39
+     * @return integer[]
40 40
      */
41 41
     protected function getRotatingAngles() {
42 42
         return [15, 90];
@@ -162,6 +162,11 @@  discard block
 block discarded – undo
162 162
         }, $this->getRotatingAngles());
163 163
     }
164 164
 
165
+    /**
166
+     * @param string $glyphIcon
167
+     * @param string $title
168
+     * @param string $onClick
169
+     */
165 170
     protected function renderIconButton($glyphIcon, $title, $onClick) {
166 171
         return $this->renderButton(new Element('span', ['class' => 'glyphicon glyphicon-' . $glyphIcon]), $title, $onClick);
167 172
     }
@@ -176,7 +181,7 @@  discard block
 block discarded – undo
176 181
 
177 182
     /**
178 183
      * @param Parameter $parameter
179
-     * @return array|\rtens\domin\delivery\web\Element[]
184
+     * @return Element[]
180 185
      */
181 186
     public function headElements(Parameter $parameter) {
182 187
         $script = file_get_contents(__DIR__ . '/js/ImageField.js');
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function render(Parameter $parameter, $value) {
88 88
         return
89
-            $this->renderImagePreservation($parameter, $value ? $value->getFile() : null) .
89
+            $this->renderImagePreservation($parameter, $value ? $value->getFile() : null).
90 90
             new Element('div', ['class' => 'image-cropper'], [
91 91
                 new Element('label', [], [
92 92
                     new Element('span', ['class' => 'btn btn-success'], ['Choose Image']),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 new Element("input", [
107 107
                     'type' => 'hidden',
108 108
                     'class' => "image-data",
109
-                    'name' => $parameter->getName() . '[encoded]'
109
+                    'name' => $parameter->getName().'[encoded]'
110 110
                 ]),
111 111
 
112 112
                 new Element('div', ['class' => 'image-container', 'style' => 'display: none;'], [
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     private function renderAspectRatioButtons() {
153
-        return array_map(function ($ratio) {
153
+        return array_map(function($ratio) {
154 154
             list($nom, $den) = $ratio;
155 155
             return $this->renderButton("$nom:$den", "Fix aspect ratio to $nom:$den", "$(this).setOption('setAspectRatio', $nom/$den)");
156 156
         }, $this->getAspectRatios());
157 157
     }
158 158
 
159 159
     private function renderRotationButtons() {
160
-        return array_map(function ($angle) {
160
+        return array_map(function($angle) {
161 161
             return $this->renderButton("$angle°", "Rotate by $angle degree", "$(this).setOption('rotate', $angle)");
162 162
         }, $this->getRotatingAngles());
163 163
     }
164 164
 
165 165
     protected function renderIconButton($glyphIcon, $title, $onClick) {
166
-        return $this->renderButton(new Element('span', ['class' => 'glyphicon glyphicon-' . $glyphIcon]), $title, $onClick);
166
+        return $this->renderButton(new Element('span', ['class' => 'glyphicon glyphicon-'.$glyphIcon]), $title, $onClick);
167 167
     }
168 168
 
169 169
     protected function renderButton($caption, $title, $onClick) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @return array|\rtens\domin\delivery\web\Element[]
180 180
      */
181 181
     public function headElements(Parameter $parameter) {
182
-        $script = file_get_contents(__DIR__ . '/js/ImageField.js');
182
+        $script = file_get_contents(__DIR__.'/js/ImageField.js');
183 183
 
184 184
         $script = str_replace(
185 185
             '$cropperOptions$',
Please login to merge, or discard this patch.
src/delivery/web/renderers/dashboard/types/Panel.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
     }
107 107
 
108 108
     /**
109
-     * @param array|Element[] $rightHeading
109
+     * @param Element[] $rightHeading
110 110
      * @return static
111 111
      */
112 112
     public function setRightHeading(array $rightHeading) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         if ($this->maxHeight) {
49 49
             $content[] = new Element('div', [
50 50
                 'class' => 'panel-body',
51
-                'style' => 'overflow-x: auto; overflow-y: hidden; max-height: ' . $this->maxHeight,
51
+                'style' => 'overflow-x: auto; overflow-y: hidden; max-height: '.$this->maxHeight,
52 52
                 'data-maxheight' => $this->maxHeight
53 53
             ], [
54 54
                 $renderers->getRenderer($this->content)->render($this->content)
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
                 new Element('div', ['class' => 'pull-right'], [
58 58
                     new Element('a', [
59 59
                         'href' => 'javascript:',
60
-                        'onclick' => "var body = $(this).closest('.panel').find('.panel-body');" .
61
-                            "body.css('max-height', 'none');" .
62
-                            "body.css('overflow-y', 'visible');" .
63
-                            "$(this).hide(); " .
60
+                        'onclick' => "var body = $(this).closest('.panel').find('.panel-body');".
61
+                            "body.css('max-height', 'none');".
62
+                            "body.css('overflow-y', 'visible');".
63
+                            "$(this).hide(); ".
64 64
                             "$(this).next().show();",
65 65
                         'class' => 'show-all'
66 66
                     ], [
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
                     ]),
70 70
                     new Element('a', [
71 71
                         'href' => 'javascript:',
72
-                        'onclick' => "var body = $(this).closest('.panel').find('.panel-body');" .
73
-                            "body.css('max-height', body.data('maxheight'));" .
74
-                            "body.css('overflow-y', 'hidden');" .
75
-                            "$(this).hide();" .
72
+                        'onclick' => "var body = $(this).closest('.panel').find('.panel-body');".
73
+                            "body.css('max-height', body.data('maxheight'));".
74
+                            "body.css('overflow-y', 'hidden');".
75
+                            "$(this).hide();".
76 76
                             "$(this).prev().show();",
77 77
                         'class' => 'show-less',
78 78
                         'style' => 'display: none'
Please login to merge, or discard this patch.
src/delivery/web/renderers/ListRenderer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     /**
26 26
      * @param array $value
27
-     * @return mixed
27
+     * @return string
28 28
      */
29 29
     public function render($value) {
30 30
         $items = [];
Please login to merge, or discard this patch.
src/delivery/web/renderers/MapRenderer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
     /**
31 31
      * @param array $array
32
-     * @return mixed
32
+     * @return Element
33 33
      */
34 34
     public function render($array) {
35 35
         $content = [
Please login to merge, or discard this patch.
src/delivery/web/renderers/tables/TableRenderer.php 2 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     /**
32 32
      * @param Table $value
33
-     * @return mixed
33
+     * @return null|string
34 34
      */
35 35
     public function render($value) {
36 36
         $rows = $this->renderRows($value);
@@ -44,6 +44,9 @@  discard block
 block discarded – undo
44 44
         ], $rows));
45 45
     }
46 46
 
47
+    /**
48
+     * @param Table $table
49
+     */
47 50
     private function renderHeaders($table) {
48 51
         $headers = [new Element('th', ['width' => '1'])];
49 52
         foreach ($this->getHeaders($table) as $caption) {
@@ -89,7 +92,7 @@  discard block
 block discarded – undo
89 92
 
90 93
     /**
91 94
      * @param Table $table
92
-     * @return mixed
95
+     * @return string[]
93 96
      */
94 97
     protected function getHeaders($table) {
95 98
         return $table->getHeaders();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use rtens\domin\delivery\web\Element;
6 6
 use rtens\domin\delivery\web\renderers\link\LinkPrinter;
7 7
 use rtens\domin\delivery\web\WebRenderer;
8
-use watoki\reflect\Property;
9 8
 
10 9
 class TableRenderer implements WebRenderer {
11 10
 
Please login to merge, or discard this patch.
src/delivery/web/HeadElements.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * @return array|string[]
42 42
      */
43 43
     public static function filter(array $headElements) {
44
-        return array_values(array_unique(array_map(function (Element $element) {
44
+        return array_values(array_unique(array_map(function(Element $element) {
45 45
             return (string)$element;
46 46
         }, $headElements)));
47 47
     }
Please login to merge, or discard this patch.
src/delivery/web/menu/CustomMenuItem.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
     public function __construct($content) {
16 16
         if (!is_callable($content)) {
17
-            $content = function () use ($content) {
17
+            $content = function() use ($content) {
18 18
                 return $content;
19 19
             };
20 20
         }
Please login to merge, or discard this patch.