Skip to content

Rector\NodeTypeResolver\StaticTypeMapper::mapPHPStanTypeToDocString for PHPStan\Type\ResourceType #2515

@staabm

Description

@staabm
Subject Details
Rector version 0.6.4
PHP version PHP 7.3
Full Command rector process redaxo/src/core/lib --autoload-file phpstan-bootstrap.php

Current Behaviour

analyzing this file
https://github.com/redaxo/redaxo/blob/master/redaxo/src/core/lib/util/socket/socket_response.php leads to

[ERROR] Could not process "C:\xampp7.3\htdocs\redaxo\redaxo\src\core\lib\util\socket\socket_response.php" file, due to:

         "Rector\NodeTypeResolver\StaticTypeMapper::mapPHPStanTypeToDocString for PHPStan\Type\ResourceType".

I guess its related to a param typed as resource, see

    /**
     * Constructor.
     *
     * @param resource $stream Socket stream
     *
     * @throws InvalidArgumentException
     */
    public function __construct($stream)
    {

resource is a type which is used through the php.net manual etc, therefore should be known to rector?

using rector.yaml:

# rector.yaml
services:
    Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector: ~

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