@@ 559-568 (lines=10) @@ | ||
556 | * |
|
557 | * @Transform /^(?:(the|a)) time of (?<val>.*)$/ |
|
558 | */ |
|
559 | public function castRelativeToAbsoluteTime($prefix, $val) |
|
560 | { |
|
561 | $timestamp = strtotime($val); |
|
562 | if (!$timestamp) { |
|
563 | throw new \InvalidArgumentException(sprintf( |
|
564 | "Can't resolve '%s' into a valid datetime value", |
|
565 | $val |
|
566 | )); |
|
567 | } |
|
568 | return date($this->timeFormat, $timestamp); |
|
569 | } |
|
570 | ||
571 | /** |
|
@@ 578-587 (lines=10) @@ | ||
575 | * |
|
576 | * @Transform /^(?:(the|a)) datetime of (?<val>.*)$/ |
|
577 | */ |
|
578 | public function castRelativeToAbsoluteDatetime($prefix, $val) |
|
579 | { |
|
580 | $timestamp = strtotime($val); |
|
581 | if (!$timestamp) { |
|
582 | throw new \InvalidArgumentException(sprintf( |
|
583 | "Can't resolve '%s' into a valid datetime value", |
|
584 | $val |
|
585 | )); |
|
586 | } |
|
587 | return date($this->datetimeFormat, $timestamp); |
|
588 | } |
|
589 | ||
590 | /** |
|
@@ 597-606 (lines=10) @@ | ||
594 | * |
|
595 | * @Transform /^(?:(the|a)) date of (?<val>.*)$/ |
|
596 | */ |
|
597 | public function castRelativeToAbsoluteDate($prefix, $val) |
|
598 | { |
|
599 | $timestamp = strtotime($val); |
|
600 | if (!$timestamp) { |
|
601 | throw new \InvalidArgumentException(sprintf( |
|
602 | "Can't resolve '%s' into a valid datetime value", |
|
603 | $val |
|
604 | )); |
|
605 | } |
|
606 | return date($this->dateFormat, $timestamp); |
|
607 | } |
|
608 | ||
609 | public function getDateFormat() |