| 1 | <?php |
||
| 20 | abstract class Period implements AddonInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var int |
||
| 24 | */ |
||
| 25 | protected $value; |
||
| 26 | |||
| 27 | 9 | public function __construct($value) |
|
| 31 | |||
| 32 | 2 | public function getValue() |
|
| 36 | |||
| 37 | protected static $periods = [ |
||
| 38 | 'month' => MonthPeriod::class, |
||
| 39 | 'months' => MonthPeriod::class, |
||
| 40 | 'year' => YearPeriod::class, |
||
| 41 | 'years' => YearPeriod::class, |
||
| 42 | ]; |
||
| 43 | |||
| 44 | 9 | public static function fromString($string) |
|
| 56 | |||
| 57 | 9 | public static function ensureValidValue($value) |
|
| 65 | } |
||
| 66 |