ClearChunkCommand and ClearOrphansCommand changes to remove deprecations in Symfony 6.1
Hi, Would it be possible to change $defaultName property usage (overriding) in commands (ClearChunkCommand and ClearOrphansCommand) to attribute? Is this planned for future release? I've upgraded my project to Symfony 6 and it shows now: The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it in "Oneup\UploaderBundle\Command\ClearChunkCommand". The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it in "Oneup\UploaderBundle\Command\ClearOrphansCommand".
Eg. in src/Command/ClearChunkCOmmand.php
+use Symfony\Component\Console\Attribute\AsCommand;
+#[AsCommand(name: 'oneup:uploader:clear-chunks', description: 'Clear chunks according to the max-age you defined in your configuration.')]
class ClearChunkCommand extends Command
{
- protected static $defaultName = 'oneup:uploader:clear-chunks'; // Make command lazy load
/**
* @var ChunkManager
*/
private $manager;
public function __construct(ChunkManager $manager)
{
$this->manager = $manager;
parent::__construct();
}
- protected function configure(): void
- {
- $this
- ->setDescription('Clear chunks according to the max-age you defined in your configuration.')
- ;
- }
How to reproduce: Compile project using OneupUploaderBundle in Symfony 6.1.3
|-------- | ------ | Version | 4.0.1 |Symfony|6.1.3
Is this shown as an error (script execution fails) or just a (deprecation) notice?
Sorry for delay. It is just deprecation notice at the moment.
Good day,
please see: #434
Fixed in #436