mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Uses PHP8's constructor property promotion in core/Command/Db classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
This commit is contained in:
parent
ceee417d2c
commit
b5cbba7fc1
9 changed files with 27 additions and 58 deletions
|
|
@ -45,14 +45,11 @@ use Symfony\Component\EventDispatcher\GenericEvent;
|
|||
* @package OC\Core\Command\Db
|
||||
*/
|
||||
class AddMissingColumns extends Command {
|
||||
private Connection $connection;
|
||||
private EventDispatcherInterface $dispatcher;
|
||||
|
||||
public function __construct(Connection $connection, EventDispatcherInterface $dispatcher) {
|
||||
public function __construct(
|
||||
private Connection $connection,
|
||||
private EventDispatcherInterface $dispatcher,
|
||||
) {
|
||||
parent::__construct();
|
||||
|
||||
$this->connection = $connection;
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
|
|
|
|||
|
|
@ -53,14 +53,11 @@ use Symfony\Component\EventDispatcher\GenericEvent;
|
|||
* @package OC\Core\Command\Db
|
||||
*/
|
||||
class AddMissingIndices extends Command {
|
||||
private Connection $connection;
|
||||
private EventDispatcherInterface $dispatcher;
|
||||
|
||||
public function __construct(Connection $connection, EventDispatcherInterface $dispatcher) {
|
||||
public function __construct(
|
||||
private Connection $connection,
|
||||
private EventDispatcherInterface $dispatcher,
|
||||
) {
|
||||
parent::__construct();
|
||||
|
||||
$this->connection = $connection;
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
|
|
|
|||
|
|
@ -45,14 +45,11 @@ use Symfony\Component\EventDispatcher\GenericEvent;
|
|||
* @package OC\Core\Command\Db
|
||||
*/
|
||||
class AddMissingPrimaryKeys extends Command {
|
||||
private Connection $connection;
|
||||
private EventDispatcherInterface $dispatcher;
|
||||
|
||||
public function __construct(Connection $connection, EventDispatcherInterface $dispatcher) {
|
||||
public function __construct(
|
||||
private Connection $connection,
|
||||
private EventDispatcherInterface $dispatcher,
|
||||
) {
|
||||
parent::__construct();
|
||||
|
||||
$this->connection = $connection;
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
|
|
|
|||
|
|
@ -42,10 +42,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||
|
||||
class ConvertFilecacheBigInt extends Command {
|
||||
private Connection $connection;
|
||||
|
||||
public function __construct(Connection $connection) {
|
||||
$this->connection = $connection;
|
||||
public function __construct(private Connection $connection) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,21 +37,12 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class ConvertMysqlToMB4 extends Command {
|
||||
private IConfig $config;
|
||||
private IDBConnection $connection;
|
||||
private IURLGenerator $urlGenerator;
|
||||
private LoggerInterface $logger;
|
||||
|
||||
public function __construct(
|
||||
IConfig $config,
|
||||
IDBConnection $connection,
|
||||
IURLGenerator $urlGenerator,
|
||||
LoggerInterface $logger
|
||||
private IConfig $config,
|
||||
private IDBConnection $connection,
|
||||
private IURLGenerator $urlGenerator,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
$this->config = $config;
|
||||
$this->connection = $connection;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->logger = $logger;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,13 +56,12 @@ use function preg_match;
|
|||
use function preg_quote;
|
||||
|
||||
class ConvertType extends Command implements CompletionAwareInterface {
|
||||
protected IConfig $config;
|
||||
protected ConnectionFactory $connectionFactory;
|
||||
protected array $columnTypes;
|
||||
|
||||
public function __construct(IConfig $config, ConnectionFactory $connectionFactory) {
|
||||
$this->config = $config;
|
||||
$this->connectionFactory = $connectionFactory;
|
||||
public function __construct(
|
||||
protected IConfig $config,
|
||||
protected ConnectionFactory $connectionFactory,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,13 +35,10 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class ExecuteCommand extends Command implements CompletionAwareInterface {
|
||||
private Connection $connection;
|
||||
private IConfig $config;
|
||||
|
||||
public function __construct(Connection $connection, IConfig $config) {
|
||||
$this->connection = $connection;
|
||||
$this->config = $config;
|
||||
|
||||
public function __construct(
|
||||
private Connection $connection,
|
||||
private IConfig $config,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class MigrateCommand extends Command implements CompletionAwareInterface {
|
||||
private Connection $connection;
|
||||
|
||||
public function __construct(Connection $connection) {
|
||||
$this->connection = $connection;
|
||||
public function __construct(private Connection $connection) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,10 +34,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class StatusCommand extends Command implements CompletionAwareInterface {
|
||||
private Connection $connection;
|
||||
|
||||
public function __construct(Connection $connection) {
|
||||
$this->connection = $connection;
|
||||
public function __construct(private Connection $connection) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue