Skip to content

PHPStan: Type safety issues and unused code #5

@Vitexus

Description

@Vitexus

PHPStan level 5 reports several type safety issues and unused code.

Found running PHPStan 2.x with PHP 8.4.

Issues

Type mismatch in RPC/Adapters/JsonAdapter.php:90

Parameter #3 $responseData of InvalidRpcResponseDataTypeException constructor expects array, but mixed is given.

PHPDoc mismatch in RPC/Adapters/XmlAdapter.php:65

@var tag with type mixed is not subtype of native type array|null.

Unused method DataObjects/User.php:437

Static method User::isValidGender() is unused.

Unused property type in Exceptions/Message/DuplicateAttachmentNameException.php:20

Property $name (string|null) is never assigned string, so string can be removed from the type.

Return type mismatch in Consistence/Enum/Enum.php:119

Method Enum::get() should return static but returns Enum.

How to reproduce

vendor/bin/phpstan analyse --level=5 src/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions