UnitValue.php
19 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kubio\Core\StyleManager\Generics; |
| 4 | |
| 5 | use Kubio\Core\StyleManager\ParserUtils; |
| 6 | use Kubio\Core\StyleManager\Props\Property; |
| 7 | use Kubio\Core\Styles\Utils; |
| 8 | use function is_string; |
| 9 | |
| 10 | class UnitValue extends Property { |
| 11 | public function __toString() { |
| 12 | if ( is_string( $this->value ) ) { |
| 13 | return $this->value; |
| 14 | } |
| 15 | |
| 16 | return ParserUtils::toValueUnitString( $this->value, $this->default ); |
| 17 | } |
| 18 | } |
| 19 |