Upgrading psr/simple-cache 1 to 2
Breaking1.0.1 → 2.0.0Breaking2Platform1
BreakingUpgrade verdict
2 breaking changes and a platform requirement change.
In plain terms
- The interfaces now declare parameter types, so any class implementing them must update its method signatures to match.
- The CacheException interface now extends Throwable, so implementations must account for that hierarchy.
- This version only runs on PHP 8 or newer.
Must act 3 items need code or config changes
PHP requirement changed in 2.0.0: >=5.3.0 → >=8.0.0.
What you must change
Breaking2
Adds parameter types to the interfaces, which breaks implementations that do not declare matching types.
Makes
CacheException extend \Throwable.CacheException\ThrowablePlatform1
Requires PHP 8.
API changes
Generated by DepDelta from published PHP source. Not mixed with prose notes.
- changed:
interface CacheException → interface CacheException extends \Throwable - changed:
method CacheInterface.delete($key) → method CacheInterface.delete(string $key) - changed:
method CacheInterface.deleteMultiple($keys) → method CacheInterface.deleteMultiple(iterable $keys) - changed:
method CacheInterface.get($key, $default = …) → method CacheInterface.get(string $key, mixed $default = …) - changed:
method CacheInterface.getMultiple($keys, $default = …) → method CacheInterface.getMultiple(iterable $keys, mixed $default = …) - changed:
method CacheInterface.has($key) → method CacheInterface.has(string $key) - changed:
method CacheInterface.set($key, $value, $ttl = …) → method CacheInterface.set(string $key, mixed $value, null|int|\DateInterval $ttl = …) - changed:
method CacheInterface.setMultiple($values, $ttl = …) → method CacheInterface.setMultiple(iterable $values, null|int|\DateInterval $ttl = …)