Update commands to php 8.1
This commit is contained in:
parent
55395666b7
commit
3920ed4244
@ -14,7 +14,7 @@ use Symfony\Component\Console\Question\Question;
|
|||||||
class CreateDatabaseCommand extends Command
|
class CreateDatabaseCommand extends Command
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -16,7 +16,7 @@ class DeleteDatabaseCommand extends Command
|
|||||||
use SelectDatabaseQuestion;
|
use SelectDatabaseQuestion;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
class ListDatabasesCommand extends Command
|
class ListDatabasesCommand extends Command
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
class ListUsersCommand extends Command
|
class ListUsersCommand extends Command
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -16,7 +16,7 @@ class PurgeDatabaseCommand extends Command
|
|||||||
use SelectDatabaseQuestion;
|
use SelectDatabaseQuestion;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -19,8 +19,8 @@ class RestoreDatabaseCommand extends Command
|
|||||||
use SelectDatabaseQuestion;
|
use SelectDatabaseQuestion;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DatabaseService $db,
|
private readonly DatabaseService $db,
|
||||||
private BackupService $bs,
|
private readonly BackupService $bs,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Service;
|
namespace App\Service;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use mysqli;
|
use mysqli;
|
||||||
|
|
||||||
class MysqliConnection
|
class MysqliConnection
|
||||||
@ -12,7 +13,7 @@ class MysqliConnection
|
|||||||
{
|
{
|
||||||
$this->connection = new mysqli($credentials->getHostname(), $credentials->getUser(), $credentials->getPassword());
|
$this->connection = new mysqli($credentials->getHostname(), $credentials->getUser(), $credentials->getPassword());
|
||||||
if ($this->connection->connect_error) {
|
if ($this->connection->connect_error) {
|
||||||
throw new \Exception("Connection failed: " . $this->connection->connect_error);
|
throw new Exception("Connection failed: " . $this->connection->connect_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user