Skip to content

Upgrading psr/cache 1 to 2

Breaking1.0.1 → 2.0.0Breaking3Platform1

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • 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.
4 items need code or config changes

PHP requirement changed in 2.0.0: >=5.3.0 → >=8.0.0.

Breaking3
The CacheItemInterface::expiresAt() $expiration parameter is now typehinted with DateTimeInterface.
CacheItemInterface::expiresAt()DateTimeInterface
All methods have typed parameters.
Psr\Cache\CacheException now extends Throwable.
Psr\Cache\CacheExceptionThrowable
Platform1
Bumps the required PHP version to 8.0.

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)