Skip to content

v1.4.0

Latest

Choose a tag to compare

@paulbalandan paulbalandan released this 08 Aug 09:50
· 2 commits to 1.x since this release
Immutable release. Only release title and notes can be modified.
v1.4.0
bcd1f1d

Added

  • isNonEmptyList() expectation, narrowing to non-empty-list<mixed>
  • isSameOrSubclassOf(class-string<T>|T $class) expectation, the non-strict counterpart of isSubclassOf, narrowing to class-string<T>|T for the given class as well as its subclasses. Unlike isSubclassOf, a literal class argument also narrows under not(), to mixed~(class-string<T>|T)
  • implementsInterface(class-string<T> $interface) expectation, narrowing to class-string<T>
  • isInstanceOfAny(non-empty-list<class-string> $classes) expectation, narrowing to the union of the given classes, or to object when the list is not known statically
  • isClassString() expectation, narrowing to class-string. Accepts interface names as well as class names, matching what PHPStan counts as a class-string

Changed

  • ExpectationMethodResolver::__construct() now takes a PHPStan\Reflection\ReflectionProvider. The service is autowired through extension.neon, so registration is unaffected

Full Changelog: v1.3.0...v1.4.0