UnitValue.php
18 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 function is_string; |
| 8 | |
| 9 | class UnitValue extends Property { |
| 10 | public function __toString() { |
| 11 | if ( is_string( $this->value ) ) { |
| 12 | return $this->value; |
| 13 | } |
| 14 | |
| 15 | return ParserUtils::toValueUnitString( $this->value, $this->default ); |
| 16 | } |
| 17 | } |
| 18 |