Skip to content

Commit 69509ea

Browse files
committed
Replace $defaultName with #[AsCommand] attribute
Fixes PHPStan errors: untyped static property and mixed passed to parent::__construct(). The attribute is the idiomatic Symfony approach since Console 5.3.
1 parent c92f96c commit 69509ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/HtaccessCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Madewithlove\HtaccessApiClient\HtaccessResult;
1010
use Madewithlove\HtaccessApiClient\ServerVariables;
1111
use RuntimeException;
12+
use Symfony\Component\Console\Attribute\AsCommand;
1213
use Symfony\Component\Console\Command\Command;
1314
use Symfony\Component\Console\Exception\RuntimeException as SymfonyRuntimeException;
1415
use Symfony\Component\Console\Input\InputArgument;
@@ -18,15 +19,14 @@
1819
use Symfony\Component\Console\Style\SymfonyStyle;
1920
use Symfony\Component\Yaml\Yaml;
2021

22+
#[AsCommand(name: 'htaccess')]
2123
final class HtaccessCommand extends Command
2224
{
23-
protected static $defaultName = 'htaccess';
24-
2525
public function __construct(
2626
private HtaccessClient $htaccessClient,
2727
private TableRenderer $tableRenderer
2828
) {
29-
parent::__construct(self::$defaultName);
29+
parent::__construct();
3030
}
3131

3232
protected function configure(): void

0 commit comments

Comments
 (0)