Position.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Asset\Script\Inline; |
| 6 | |
| 7 | final class Position |
| 8 | { |
| 9 | |
| 10 | public const BEFORE = 'before'; |
| 11 | public const AFTER = 'after'; |
| 12 | |
| 13 | private string $position; |
| 14 | |
| 15 | private function __construct(string $position) |
| 16 | { |
| 17 | $this->position = $position; |
| 18 | } |
| 19 | |
| 20 | public static function before(): self |
| 21 | { |
| 22 | return new self(self::BEFORE); |
| 23 | } |
| 24 | |
| 25 | public static function after(): self |
| 26 | { |
| 27 | return new self(self::AFTER); |
| 28 | } |
| 29 | |
| 30 | public function __toString(): string |
| 31 | { |
| 32 | return $this->position; |
| 33 | } |
| 34 | |
| 35 | } |