Skip to content

Conversation

samuelmaudo
Copy link
Contributor

This PR configures a rule for fully qualified symbol references.

With this change to its configuration, this code:

namespace Foo\Test;

class Foo extends \Other\BaseClass implements \Other\Interface1, \Other\Interface2
{
    /** @var \Other\PropertyPhpDoc */
    private $array;
    public function __construct(\Other\FunctionArgument $arg) {}
    public function foo(): \Other\FunctionReturnType
    {
        try {
            \Other\StaticFunctionCall::bar();
        } catch (\Other\CaughtThrowable $e) {}
    }
}

becomes:

namespace Foo\Test;

use Other\BaseClass;
use Other\CaughtThrowable;
use Other\FunctionArgument;
use Other\FunctionReturnType;
use Other\Interface1;
use Other\Interface2;
use Other\PropertyPhpDoc;
use Other\StaticFunctionCall;

class Foo extends BaseClass implements Interface1, Interface2
{
    /** @var PropertyPhpDoc */
    private $array;
    public function __construct(FunctionArgument $arg) {}
    public function foo(): FunctionReturnType
    {
        try {
            StaticFunctionCall::bar();
        } catch (CaughtThrowable $e) {}
    }
}

I have also removed the @see PHPDoc tag because we have several uses of this tag with fully qualified symbol references, and they refer to other classes that are not used in the class code.

@samuelmaudo samuelmaudo self-assigned this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant