@@ -195,12 +195,12 @@ |
||
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - /** |
|
| 199 | - * Get the hostname currently associated with an IP value. |
|
| 200 | - * |
|
| 201 | - * @param mixed $val The value to convert to string. |
|
| 202 | - * @return string |
|
| 203 | - */ |
|
| 198 | + /** |
|
| 199 | + * Get the hostname currently associated with an IP value. |
|
| 200 | + * |
|
| 201 | + * @param mixed $val The value to convert to string. |
|
| 202 | + * @return string |
|
| 203 | + */ |
|
| 204 | 204 | public function hostname($val) |
| 205 | 205 | { |
| 206 | 206 | $val = $this->stringVal($val); |
@@ -161,8 +161,8 @@ |
||
| 161 | 161 | private function dateTimeVal($val) |
| 162 | 162 | { |
| 163 | 163 | if ($val === null || |
| 164 | - (is_string($val) && ! strlen(trim($val))) || |
|
| 165 | - (is_array($val) && ! count(array_filter($val, 'strlen'))) |
|
| 164 | + (is_string($val) && !strlen(trim($val))) || |
|
| 165 | + (is_array($val) && !count(array_filter($val, 'strlen'))) |
|
| 166 | 166 | ) { |
| 167 | 167 | return null; |
| 168 | 168 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
| 262 | - * @return array |
|
| 262 | + * @return string[] |
|
| 263 | 263 | */ |
| 264 | 264 | public function validationMethods() |
| 265 | 265 | { |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
| 353 | - * @param integer|string $timestamp Timestamp. |
|
| 353 | + * @param integer $timestamp Timestamp. |
|
| 354 | 354 | * @return boolean |
| 355 | 355 | */ |
| 356 | 356 | private function isValidTimeStamp($timestamp) |
@@ -3,7 +3,6 @@ discard block |
||
| 3 | 3 | namespace Charcoal\Property; |
| 4 | 4 | |
| 5 | 5 | use PDO; |
| 6 | -use Exception; |
|
| 7 | 6 | use LogicException; |
| 8 | 7 | use RuntimeException; |
| 9 | 8 | use InvalidArgumentException; |
@@ -11,7 +10,6 @@ discard block |
||
| 11 | 10 | // From PSR-3 |
| 12 | 11 | use Psr\Log\LoggerAwareInterface; |
| 13 | 12 | use Psr\Log\LoggerAwareTrait; |
| 14 | -use Psr\Log\NullLogger; |
|
| 15 | 13 | |
| 16 | 14 | // From Pimple |
| 17 | 15 | use Pimple\Container; |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | return []; |
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | - $val = array_map([ $this, 'parseOne' ], $val); |
|
| 359 | + $val = array_map([$this, 'parseOne'], $val); |
|
| 360 | 360 | } else { |
| 361 | 361 | if ($this['l10n']) { |
| 362 | 362 | $val = $this->translator()->translation($val); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | public function getLabel() |
| 484 | 484 | { |
| 485 | 485 | if ($this->label === null) { |
| 486 | - return ucwords(str_replace([ '.', '_' ], ' ', $this->ident())); |
|
| 486 | + return ucwords(str_replace(['.', '_'], ' ', $this->ident())); |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | return $this->label; |
@@ -741,7 +741,7 @@ |
||
| 741 | 741 | /** |
| 742 | 742 | * Legacy support of active() instead of getActive(). |
| 743 | 743 | * |
| 744 | - * @return string |
|
| 744 | + * @return boolean |
|
| 745 | 745 | */ |
| 746 | 746 | public function active() |
| 747 | 747 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Charcoal\Property; |
| 4 | 4 | |
| 5 | -use PDO; |
|
| 6 | 5 | use ArrayAccess; |
| 7 | 6 | use RuntimeException; |
| 8 | 7 | use InvalidArgumentException; |
@@ -570,7 +570,7 @@ |
||
| 570 | 570 | $objs = (array)$this->structureVal($val); |
| 571 | 571 | $val = []; |
| 572 | 572 | if (!empty($objs)) { |
| 573 | - $val = []; |
|
| 573 | + $val = []; |
|
| 574 | 574 | foreach ($objs as $obj) { |
| 575 | 575 | $obj->saveProperties(); |
| 576 | 576 | $val[] = $obj->data(); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PDO; |
| 6 | 6 | use InvalidArgumentException; |
| 7 | -use UnexpectedValueException; |
|
| 8 | 7 | |
| 9 | 8 | // From 'charcoal-translator' |
| 10 | 9 | use Charcoal\Translator\Translation; |
@@ -277,7 +277,7 @@ |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /** |
| 280 | - * @return mixed |
|
| 280 | + * @return string |
|
| 281 | 281 | */ |
| 282 | 282 | public function defaultVal() |
| 283 | 283 | { |
@@ -312,7 +312,7 @@ |
||
| 312 | 312 | return ''; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $parts = [ sprintf('`%s`', $ident) ]; |
|
| 315 | + $parts = [sprintf('`%s`', $ident)]; |
|
| 316 | 316 | |
| 317 | 317 | $dataType = $this->sqlType(); |
| 318 | 318 | if ($dataType) { |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Traversable; |
| 6 | 6 | use RuntimeException; |
| 7 | 7 | use InvalidArgumentException; |
| 8 | - |
|
| 9 | 8 | use PDO; |
| 10 | 9 | |
| 11 | 10 | // From PSR-6 |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * |
| 62 | 62 | * @param array $propertyIdents Optional. List of property identifiers |
| 63 | 63 | * for retrieving a subset of property objects. |
| 64 | - * @return PropertyInterface[]|\Generator |
|
| 64 | + * @return \Generator |
|
| 65 | 65 | */ |
| 66 | 66 | public function properties(array $propertyIdents = null) |
| 67 | 67 | { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * @param mixed $label The true label. |
|
| 108 | + * @param string $label The true label. |
|
| 109 | 109 | * @return self |
| 110 | 110 | */ |
| 111 | 111 | public function setTrueLabel($label) |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * @param mixed $label The false label. |
|
| 130 | + * @param string $label The false label. |
|
| 131 | 131 | * @return self |
| 132 | 132 | */ |
| 133 | 133 | public function setFalseLabel($label) |