19 declare(strict_types=1);
35 public function __construct(
protected string $value)
39 public function value():
string 49 public function durationToIterator(
string $duration): \Generator
51 foreach (explode(
':', $duration) as $v) {
52 yield $v ===
'' ? null : $v;
59 foreach ($this->durationToIterator($duration) as $v) {
67 return new \DateTimeImmutable($datetime);
78 $array = [$years, $months, $days, $hours, $minutes, $seconds];
79 return implode(
':', $array);
84 return $object->format(
'Y-m-d');
91 return 'presentable ' . $data->value();
104 $helper->makePresentable($this->getData(
'value'))
113 'presentable value1,? ,.presentable value2,? ,.presentable value3',
114 $helper->makePresentableAsList(
116 $this->getData(
'value1'),
128 [89, 0, null, null, null, 1],
129 $helper->durationToArray(
'89:0::::1')
139 $helper->durationToSeconds(
'89:5::::1')
149 $helper->datetimeToObject(
'2013-01-20')->format(
'Y-m-d')
159 $helper->durationFromIntegers(89, 0, null, null, null, 1)