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
|
||||
{
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private readonly DatabaseService $db,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -16,7 +16,7 @@ class DeleteDatabaseCommand extends Command
|
||||
use SelectDatabaseQuestion;
|
||||
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private readonly DatabaseService $db,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
class ListDatabasesCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private readonly DatabaseService $db,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -12,7 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
class ListUsersCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private readonly DatabaseService $db,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -16,7 +16,7 @@ class PurgeDatabaseCommand extends Command
|
||||
use SelectDatabaseQuestion;
|
||||
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private readonly DatabaseService $db,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -19,8 +19,8 @@ class RestoreDatabaseCommand extends Command
|
||||
use SelectDatabaseQuestion;
|
||||
|
||||
public function __construct(
|
||||
private DatabaseService $db,
|
||||
private BackupService $bs,
|
||||
private readonly DatabaseService $db,
|
||||
private readonly BackupService $bs,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use Exception;
|
||||
use mysqli;
|
||||
|
||||
class MysqliConnection
|
||||
@ -12,7 +13,7 @@ class MysqliConnection
|
||||
{
|
||||
$this->connection = new mysqli($credentials->getHostname(), $credentials->getUser(), $credentials->getPassword());
|
||||
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