phpstan: Docker image phpstan/phpstan:0.12 updated with breaking change

Bug report

The following error is no longer picked up by the latest 0.12 Docker image. When running PHPStan against our codebase using the 0.12 image from 2 weeks ago the baseline matches the result. When using the 0.12 image pulled today the error is no longer in the result:

I believe this has started happening sometime yesterday.

Code snippet that reproduces the problem

https://phpstan.org/r/c8caef76-2a0b-4e64-9017-29b59f86afd6

Docker run command:

docker run \
	--rm \
	-v $(pwd):/app \
	phpstan/phpstan:0.12 \
	analyse \
	-c phpstan.neon \
	--level=0 \
	src/ \
    > $OUTPUT

The specific method that causes the error: Overriding class: public function toString(string $delimiter = PHP_EOL): string Overridden class: public function toString(string $delimiter = PHP_EOL): string

Expected output

Error not being detected:

Parameter #1 $parameter (string) of method                             
<          OverridingClass::toString() is not  
<          contravariant with parameter #1 $parameter (string|null) of method     
<          OverriddenClass::toString(). 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Run the PHPStan executable in the Docker container with --version.