Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

[CS] False positive reported by CheckUnneededSymfonyStyleUsageRule #2277

Closed
TomasVotruba opened this issue Sep 30, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@TomasVotruba
Copy link
Member

This file should be skipped complete, as SymfonyStyle is needed for title() method:

<?php

declare(strict_types=1);

namespace Symplify\CodingStandard\Tests\Rules\CheckUnneededSymfonyStyleUsageRule\Fixture;

use Symfony\Component\Console\Style\SymfonyStyle;

class SkipTitleUsedSymfonyStyle
{
    private $symfonyStyle;

    public function __construct(SymfonyStyle $symfonyStyle)
    {
        $this->symfonyStyle = $symfonyStyle;
    }

    public function run()
    {
        $this->symfonyStyle->title('Welcome');
        $this->symfonyStyle->newline();
    }
}

cc @samsonasik Could you update the rule?

@samsonasik
Copy link
Collaborator

I will check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants