Upgrading psr/cache 1 to 2
Breaking1.0.1 → 2.0.0Breaking3Platform1
BreakingUpgrade verdict
3 breaking changes and a platform requirement change.
In plain terms
- Code that implements this interface must now declare the expiration parameter as a date-time object.
- Implementations of the interfaces must add the same parameter types as the interfaces now declare.
- Custom cache exceptions must now be throwable objects.
- You need PHP 8.0 or newer to install this version.
Must act 4 items need code or config changes
PHP requirement changed in 2.0.0: >=5.3.0 → >=8.0.0.
What you must change
Breaking3
The
CacheItemInterface::expiresAt() $expiration parameter is now typehinted with DateTimeInterface.CacheItemInterface::expiresAt()DateTimeInterfaceAll methods have typed parameters.
Psr\Cache\CacheException now extends Throwable.Psr\Cache\CacheExceptionThrowablePlatform1
Bumps the required PHP version to 8.0.
API changes
Generated by DepDelta from published PHP source. Not mixed with prose notes.
- changed:
interface CacheException → interface CacheException extends \Throwable - changed:
method CacheItemInterface.expiresAfter($time) → method CacheItemInterface.expiresAfter(int|\DateInterval|null $time) - changed:
method CacheItemInterface.expiresAt($expiration) → method CacheItemInterface.expiresAt(?\DateTimeInterface $expiration) - changed:
method CacheItemInterface.set($value) → method CacheItemInterface.set(mixed $value) - changed:
method CacheItemPoolInterface.deleteItem($key) → method CacheItemPoolInterface.deleteItem(string $key) - changed:
method CacheItemPoolInterface.getItem($key) → method CacheItemPoolInterface.getItem(string $key) - changed:
method CacheItemPoolInterface.hasItem($key) → method CacheItemPoolInterface.hasItem(string $key)