@@ -25,7 +25,7 @@ discard block |
||
| 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 |
||
| 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(); |
@@ -105,7 +105,7 @@ |
||
| 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 [ |
@@ -36,7 +36,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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'); |
@@ -150,14 +150,14 @@ |
||
| 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 | } |
@@ -106,7 +106,7 @@ |
||
| 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) { |
@@ -24,7 +24,7 @@ |
||
| 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 = []; |
@@ -29,7 +29,7 @@ |
||
| 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 = [ |
@@ -30,7 +30,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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(); |
@@ -5,7 +5,6 @@ |
||
| 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 | |
@@ -25,6 +25,6 @@ |
||
| 25 | 25 | * @return mixed |
| 26 | 26 | */ |
| 27 | 27 | public function render($value) { |
| 28 | - return ($this->fileDir ? $this->fileDir . DIRECTORY_SEPARATOR : '') .$value->getName(); |
|
| 28 | + return ($this->fileDir ? $this->fileDir . DIRECTORY_SEPARATOR : '') . $value->getName(); |
|
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | \ No newline at end of file |
@@ -41,7 +41,7 @@ |
||
| 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 | } |