Skip to content

Commit

Permalink
Fix some deprecations (#125)
Browse files Browse the repository at this point in the history
* Method "Doctrine\DBAL\Driver::connect()" might add "DriverConnection" as a native return type declaration in the future. Do the same in implementation "DH\Auditor\Provider\Doctrine\Auditing\Logger\Middleware\DHDriver" now to avoid errors or add an explicit @return annotation to suppress this message.

* The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it in "DH\Auditor\Provider\Doctrine\Persistence\Command\CleanAuditLogsCommand".

* alphabet

* remove AsCommand

* csfixer

Co-authored-by: a.dmitryuk <[email protected]>
  • Loading branch information
dmitryuk and a.dmitryuk authored Nov 10, 2022
1 parent 610de8f commit 2861bd3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(DriverInterface $driver)
/**
* {@inheritDoc}
*/
public function connect(array $params)
public function connect(array $params): DHConnection
{
return new DHConnection(
$this->driver->connect($params),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class CleanAuditLogsCommand extends Command

private const UNTIL_DATE_FORMAT = 'Y-m-d H:i:s';

protected static $defaultName = 'audit:clean';

private Auditor $auditor;

public function unlock(): void
Expand All @@ -53,7 +51,7 @@ protected function configure(): void
{
$this
->setDescription('Cleans audit tables')
->setName(self::$defaultName) // @phpstan-ignore-line
->setName('audit:clean')
->addOption('no-confirm', null, InputOption::VALUE_NONE, 'No interaction mode')
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Do not execute SQL queries.')
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Prints SQL related queries.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class UpdateSchemaCommand extends Command
{
use LockableTrait;

protected static $defaultName = 'audit:schema:update';

private Auditor $auditor;

public function unlock(): void
Expand All @@ -42,9 +40,9 @@ protected function configure(): void
{
$this
->setDescription('Update audit tables structure')
->setName('audit:schema:update')
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.')
->setName(self::$defaultName) // @phpstan-ignore-line
;
}

Expand Down

0 comments on commit 2861bd3

Please sign in to comment.