@@ -18,9 +18,10 @@ final class DateTimeEntry implements Entry
1818
1919 private \DateTimeInterface $ value ;
2020
21- private string $ format ;
22-
23- public function __construct (string $ name , \DateTimeInterface $ value , string $ format = \DateTimeInterface::ATOM )
21+ /**
22+ * @throws InvalidArgumentException
23+ */
24+ public function __construct (string $ name , \DateTimeInterface $ value )
2425 {
2526 if (!\strlen ($ name )) {
2627 throw InvalidArgumentException::because ('Entry name cannot be empty ' );
@@ -29,21 +30,16 @@ public function __construct(string $name, \DateTimeInterface $value, string $for
2930 $ this ->key = \mb_strtolower ($ name );
3031 $ this ->name = $ name ;
3132 $ this ->value = $ value ;
32- $ this ->format = $ format ;
3333 }
3434
3535 public function name () : string
3636 {
3737 return $ this ->name ;
3838 }
3939
40- /**
41- * @psalm-suppress MissingReturnType
42- * @psalm-suppress ImpureMethodCall
43- */
44- public function value () : string
40+ public function value () : \DateTimeInterface
4541 {
46- return $ this ->value -> format ( $ this -> format ) ;
42+ return $ this ->value ;
4743 }
4844
4945 public function is (string $ name ) : bool
@@ -58,10 +54,12 @@ public function rename(string $name) : Entry
5854
5955 /**
6056 * @psalm-suppress MixedArgument
57+ *
58+ * @throws InvalidArgumentException
6159 */
6260 public function map (callable $ mapper ) : Entry
6361 {
64- return new self ($ this ->name , $ mapper ($ this ->value ), $ this -> format );
62+ return new self ($ this ->name , $ mapper ($ this ->value ));
6563 }
6664
6765 public function isEqual (Entry $ entry ) : bool
0 commit comments