Skip to content

NarrowUnionTypeDocRector - Attempt to assign property "type" on null #6725

@puniserv

Description

@puniserv

Bug Report

Rector 7dedffe

Notice on PHP74, Fatal on PHP80

Minimal PHP Code Causing Issue

https://getrector.org/demo/1ec25e18-db6b-61f6-99e2-dd3368cadfb1

<?php

declare(strict_types=1);

class Factory
{
    /**
     * @param string|int|float|bool $value
     */
    public function create(string $name, $value): int
    {
       
    }
}
$services->set(\Rector\CodeQuality\Rector\ClassMethod\NarrowUnionTypeDocRector::class);

Expected Behaviour

No Notice/Fatal :)

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