Conversation
| * The invoked object. | ||
| */ | ||
| public function set($value); | ||
| public function set(mixed $value): static; |
There was a problem hiding this comment.
Does that mean that immutability is required?
There was a problem hiding this comment.
CacheItem explicitly cannot be an immutable object. It's a builder object. set() must return "the invoked object", so it's going to be of the same type (static) no matter what. If it's not, it's an error.
| * Sets the expiration time for this cache item. | ||
| * | ||
| * @param \DateTimeInterface|null $expiration | ||
| * @param ?\DateTimeInterface $expiration |
There was a problem hiding this comment.
I think it should stay as is: https://docs.phpdoc.org/3.0/guide/references/phpdoc/types.html
There was a problem hiding this comment.
Doesn't that make it inconsistent with the native types, then?
(PHPDoc's own spec is well over a decade old at this point, no? That's the reason PSR-5 and friends, er, tried to exist...)
There was a problem hiding this comment.
No. It's not inconsistent with PHP 8 union types and it's current PHPDocumentor 3 syntax that has wide support among IDEs and static code analysis tools.
|
This just broke projects that tests with the dev-version. |
Follow on to #23