-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Description
Bug report
Not sure what phpstan (1.4.10) doing on level 5 but 20G is not enough to parse this file 😅
<?php declare(strict_types = 1);
namespace App\Utils\Processor;
/**
* @template TState of object
*/
abstract class Processor {
public function __construct() {
// empty
}
/**
* @param TState $state
*/
protected function saveState(object $state): void {
$this->set($state);
}
/**
* @param object|array<mixed>|string|float|int|bool|null $value
*/
public function set(object|array|string|float|int|bool|null $value): mixed {
return $value;
}
}phar://vendor/phpstan/phpstan/phpstan.phar/src/Type/UnionTypeHelper.php:104
100▕ }
101▕ return \strcasecmp($a->describe(\PHPStan\Type\VerbosityLevel::value()), $b->describe(\PHPStan\Type\VerbosityLevel::value()));
102▕ }
103▕ return \strcasecmp($a->describe(\PHPStan\Type\VerbosityLevel::typeOnly()), $b->describe(\PHPStan\Type\VerbosityLevel::typeOnly()));
➜ 104▕ });
105▕ return $types;
106▕ }
107▕ }
Code snippet that reproduces the problem
https://phpstan.org/r/67f40319-d1f6-49e6-aa0a-93d53b3121f8 (set level to 5 to fail)
Expected output
no crash