Skip to content

Internal error: Return value of PHPStan\Type\IntersectionType::toBoolean() must be an instance of PHPStan\Type\BooleanType, instance of PHPStan\Type\NeverType returned #2722

@nfangxu

Description

@nfangxu
  Symfony\Component\Debug\Exception\FatalThrowableError  : Return value of PHPStan\Type\IntersectionType::toBoolean() must be an instance of PHPStan\Type\BooleanType, instance of PHPStan\Type\NeverType returned

  at [project-path]/vendor/phpstan/phpstan/src/Type/IntersectionType.php:311
    307| 		$type = $this->intersectTypes(static function (Type $type): BooleanType {
    308| 			return $type->toBoolean();
    309| 		});
    310| 
  > 311| 		return $type;
    312| 	}
    313| 
    314| 	public function toNumber(): Type
    315| 	{

  Exception trace:

  1   PHPStan\Type\IntersectionType::toBoolean()
      /Users/fx/project/hotniuer/vendor/phpstan/phpstan/src/Type/UnionType.php:501

  2   PHPStan\Type\UnionType::PHPStan\Type\{closure}(Object(PHPStan\Type\IntersectionType))
      [internal]:0

  Please use the argument -v to see more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions