Skip to content

Releases: phpstan/phpstan

0.2.1

22 Nov 07:30
Compare
Choose a tag to compare
  • Fixed checking implode() call with just one parameter $pieces
  • Fixed a crashing issue when a different version of a class from the autoloaded one is analyzed

0.2

20 Nov 15:40
Compare
Choose a tag to compare
0.2

Major new features:

  • Check types of values assigned to properties
  • Checking return types from class methods and anonymous functions
  • Check types of values appended to arrays
  • Check property access and method calls on non-objects
  • Support /** @var $foo \Type */, /** @var \Type $foo */ and /* @var ... */ preceding a variable assign
  • Support for bootstrap file (0f16708)
  • Rules are now registered via a tag so users can register their own rules (#13 - thanks @pepakriz!)
  • ArrayType knows its item type; used in foreach and dimfetches
  • Support for getting types from static calls and fetching static properties
  • Support for void type
  • Improved \Closure::bind support - it correctly checks code inside the closure

BC breaks:

  • Config option polluteScopeWithForLoopInitialAssignments renamed to polluteScopeWithLoopInitialAssignments and also applies to while-loop
  • Method parameters with typehints in both phpDocs and native PHP can now resolve to a different type (973cc8f, 93e868d, f649596)

BC breaks for authors of extensions:

  • Introducing ParameterReflection::isPassedByReference() (424eb9d)
  • Removed Scope::isInClosureBind(), type of $this is correctly resolved even inside the closure; access to private properties is also not reported when the scope is set to the correct class

Enhancements:

  • Alias analyse command to analyze (#8 - thanks @Mikulas)
  • All parameters passed by reference can create a new variable in outer scope, not just a few listed ones (05498a5)
  • Variables assigned in elseifs are available in subsequent elseifs and in else
  • Concatenated strings are always StringType
  • Handle negated instanceofs in more complex conditions
  • stdClass and SimpleXMLElement are universal object crates by default
  • Support for instanceof in cases of switch(true)
  • Checking array type of properties and method typehints
  • Performance optimization: ClassReflection - stop on first accessible property from current scope (2e64fbb)
  • Performance optimization: FileTypeMapper - additional in-memory cache to prevent frequent disk access (433804f)
  • Type of spaceship <=> operator is detected as an integer

Bugfixes:

  • Support for assigning variable with =&
  • Typehints are case-insensitive (so that NULL means the same thing as null)
  • Reinforce resolving type names from phpDocs so that internal errors do not occur
  • Fixed checking access to static properties with dynamic name
  • Do not throw an exception when unsetting undefined variable
  • Do not show progress bar in case of early errors
  • Fixed name-resolving bug when an annotation contains "new" keyword
  • Universal object crates - real properties are preferred
  • Detect variadic parameters correctly as arrays
  • Fixing PHP bug #71416

Initial release

17 Jul 20:10
Compare
Choose a tag to compare

Hello world!