DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
83 stars 10 forks source link

Conflict between `@var` and variable assignment #653

Closed ging-dev closed 1 month ago

ging-dev commented 2 months ago
<?php

declare(strict_types=1);

function a(int $a): string {
    return '';
}

$a = 1;

/** @var string */
$a = a($a); // Argument '1' passed to a() is expected to be of type int, string given
ging-dev commented 2 months ago

maybe related https://github.com/DEVSENSE/phptools-docs/issues/601

jakubmisek commented 1 month ago

preparing pre-release with the fix, thanks!