Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ declare(strict_types=1);
$baseUrl = 'http://localhost:8080';

$databases = [
'default' => [
'mariadb' => [
'host' => 'localhost',
'dbname' => 'dotkernel',
'user' => '',
'password' => '',
'port' => 3306,
'driver' => 'pdo_mysql',
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_general_ci',
'collation' => 'utf8mb4_general_ci',
'table_prefix' => '',
],
'postgresql' => [
'host' => 'localhost',
'dbname' => 'dotkernel',
'user' => '',
'password' => '',
'port' => 5432,
'driver' => 'pdo_pgsql',
'collation' => 'utf8mb4_general_ci',
'table_prefix' => '',
],
// you can add more database connections to this array
Expand All @@ -22,10 +31,10 @@ $databases = [
return [
'application' => [
'name' => 'Dotkernel API',
'version' => 6.0,
'version' => 7.0,
'url' => $baseUrl,
'versioning' => [
'documentation_url' => 'https://docs.dotkernel.org/api-documentation/v6/core-features/versioning',
'documentation_url' => 'https://docs.dotkernel.org/api-documentation/v7/tutorials/api-evolution/',
],
],
'authentication' => [
Expand All @@ -51,7 +60,7 @@ return [
'doctrine' => [
'connection' => [
'orm_default' => [
'params' => $databases['default'],
'params' => $databases['mariadb'],
],
],
],
Expand Down
29 changes: 22 additions & 7 deletions config/cli-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,35 @@

declare(strict_types=1);

use Core\App\Doctrine\MigrationsMigratedSubscriber;
use Core\App\Event\TablePrefixEventListener;
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
use Doctrine\Migrations\DependencyFactory;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Events;
use Dot\Log\LoggerInterface;
use Psr\Container\ContainerExceptionInterface;

$container = require 'config/container.php';

$entityManager = $container->get(EntityManager::class);
$entityManager->getEventManager()
->addEventListener(Events::loadClassMetadata, $container->get(TablePrefixEventListener::class));
try {
$entityManager = $container->get(EntityManager::class);
$entityManager->getEventManager()
->addEventListener(Events::loadClassMetadata, $container->get(TablePrefixEventListener::class));
$entityManager->getEventManager()
->addEventSubscriber(new MigrationsMigratedSubscriber($container));

return DependencyFactory::fromEntityManager(
new ConfigurationArray($container->get('config')['doctrine']['migrations']),
new ExistingEntityManager($entityManager)
);
return DependencyFactory::fromEntityManager(
new ConfigurationArray($container->get('config')['doctrine']['migrations']),
new ExistingEntityManager($entityManager)
);
} catch (ContainerExceptionInterface $exception) {
try {
/** @var LoggerInterface $logger */
$logger = $container->get('dot-log.default_logger');
$logger->err($exception->getMessage());

Check warning on line 32 in config/cli-config.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$exception-\>getMessage()' type is not compatible with declaration

Check warning on line 32 in config/cli-config.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$exception-\>getMessage()' type is not compatible with declaration

Check warning on line 32 in config/cli-config.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$exception-\>getMessage()' type is not compatible with declaration

Check warning on line 32 in config/cli-config.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$exception-\>getMessage()' type is not compatible with declaration
} catch (ContainerExceptionInterface $exception) {
error_log($exception->getMessage());
}
}
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/DBAL/Types/AdminRoleEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AdminRoleEnumType extends AbstractEnumType
{
public const NAME = 'admin_role_enum';

protected function getEnumClass(): string
public function getEnumClass(): string
{
return AdminRoleEnum::class;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/DBAL/Types/AdminStatusEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AdminStatusEnumType extends AbstractEnumType
{
public const NAME = 'admin_status_enum';

protected function getEnumClass(): string
public function getEnumClass(): string
{
return AdminStatusEnum::class;
}
Expand Down
26 changes: 22 additions & 4 deletions src/Core/src/App/src/DBAL/Types/AbstractEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use BackedEnum;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SQLitePlatform;
use Doctrine\DBAL\Types\Type;

Expand All @@ -17,11 +18,15 @@
{
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
if ($platform instanceof PostgreSQLPlatform) {
return $this->getName();
}

if ($platform instanceof SQLitePlatform) {
return 'TEXT';
}

$values = array_map(fn($case) => "'$case->value'", $this->getEnumValues());
$values = array_map(fn($case) => "'$case->value'", $this->getEnumCases());

return sprintf('ENUM(%s)', implode(', ', $values));
}
Expand All @@ -39,17 +44,30 @@
/**
* @return class-string
*/
abstract protected function getEnumClass(): string;
abstract public function getEnumClass(): string;

/**
* @return non-empty-string
*/
abstract public function getName(): string;

Check warning on line 52 in src/Core/src/App/src/DBAL/Types/AbstractEnumType.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 52 in src/Core/src/App/src/DBAL/Types/AbstractEnumType.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 52 in src/Core/src/App/src/DBAL/Types/AbstractEnumType.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 52 in src/Core/src/App/src/DBAL/Types/AbstractEnumType.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

/**
* @return BackedEnum[]
*/
private function getEnumValues(): array
public function getEnumCases(): array
{
return $this->getEnumClass()::cases();
}

private function getValue(mixed $value): mixed
/**
* @return list<non-empty-string>
*/
public function getEnumValues(): array
{
return $this->getEnumClass()::values();
}

public function getValue(mixed $value): mixed
{
if (! $value instanceof BackedEnum) {
return $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/DBAL/Types/SuccessFailureEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SuccessFailureEnumType extends AbstractEnumType
{
public const NAME = 'success_failure_enum';

protected function getEnumClass(): string
public function getEnumClass(): string
{
return SuccessFailureEnum::class;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/DBAL/Types/YesNoEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class YesNoEnumType extends AbstractEnumType
{
public const NAME = 'yes_no_enum';

protected function getEnumClass(): string
public function getEnumClass(): string
{
return YesNoEnum::class;
}
Expand Down
198 changes: 198 additions & 0 deletions src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<?php

declare(strict_types=1);

namespace Core\App\Doctrine;

use Core\App\DBAL\Types\AbstractEnumType;
use Doctrine\Common\EventSubscriber;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\Migrations\Events;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

use function array_column;
use function array_key_exists;
use function implode;
use function in_array;
use function sprintf;

class MigrationsMigratedSubscriber implements EventSubscriber
{
private EntityManagerInterface $entityManager;
private Connection $connection;

/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __construct(
private readonly ContainerInterface $container,
) {
$this->entityManager = $container->get('doctrine.entity_manager.orm_default');
$this->connection = $this->entityManager->getConnection();
}

/**
* @throws Exception
*/
public function getSubscribedEvents(): array
{
if (! $this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
return [];
}

return [
Events::onMigrationsMigrating,
];
}

/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function onMigrationsMigrating(): void

Check warning on line 59 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 59 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 59 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 59 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'
{
$dbEnumTypes = $this->getCustomEnumTypesFromTheDatabase();
$fsEnumTypes = $this->getCustomEnumTypesFromTheFileSystem();

$enumTypes = $this->mergeCustomEnumTypes($dbEnumTypes, $fsEnumTypes);
foreach ($enumTypes as $action => $enums) {
foreach ($enums as $type => $values) {
match ($action) {
'create' => $this->createDatabaseType($type, $values),
'delete' => $this->deleteDatabaseType($type),

Check warning on line 69 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 69 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 69 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 69 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration
'update' => $this->updateDatabaseType($type, $values),
default => null,
};
}
}
}

/**
* @phpstan-return array<non-empty-string, AbstractEnumType>
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
private function getCustomEnumTypesFromTheFileSystem(): array
{
$enumTypes = [];

$customTypes = $this->container->get('config')['doctrine']['types'] ?? [];
foreach ($customTypes as $type => $class) {
$class = new $class();
if (! $class instanceof AbstractEnumType) {
continue;
}
$enumTypes[$type] = $class;
}

return $enumTypes;
}

/**
* @phpstan-return list<non-empty-string>
* @throws Exception
*/
private function getDatabaseTypeValues(string $type): array

Check warning on line 102 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 102 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 102 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 102 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'
{
$results = $this->connection->executeQuery(
"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = '$type';"

Check warning on line 105 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = '$type';"' type is not compatible with declaration

Check warning on line 105 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = '$type';"' type is not compatible with declaration

Check warning on line 105 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = '$type';"' type is not compatible with declaration

Check warning on line 105 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '"SELECT e.enumlabel FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid WHERE t.typname = '$type';"' type is not compatible with declaration
)->fetchAllAssociative();

return array_column($results, 'enumlabel');
}

/**
* @return list<non-empty-string>
* @throws Exception
*/
private function getCustomEnumTypesFromTheDatabase(): array
{
return $this->connection->executeQuery(
'SELECT t.typname FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid GROUP BY t.typname'

Check warning on line 118 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''SELECT t.typname FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid GROUP BY t.typname'' type is not compatible with declaration

Check warning on line 118 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''SELECT t.typname FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid GROUP BY t.typname'' type is not compatible with declaration

Check warning on line 118 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''SELECT t.typname FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid GROUP BY t.typname'' type is not compatible with declaration

Check warning on line 118 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter ''SELECT t.typname FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid GROUP BY t.typname'' type is not compatible with declaration
)->fetchFirstColumn();
}

/**
* @param list<non-empty-string> $dbEnumTypes
* @param array<non-empty-string, AbstractEnumType> $fsEnumTypes
* @return array{
* create: array<non-empty-string, list<non-empty-string>>,
* delete: array<non-empty-string, list<non-empty-string>>,
* skip: array<non-empty-string, list<non-empty-string>>,
* update: array<non-empty-string, list<non-empty-string>>
* }
* @throws Exception
*/
private function mergeCustomEnumTypes(array $dbEnumTypes, array $fsEnumTypes): array
{
$enumTypes = [
'create' => [],
'delete' => [],
'skip' => [],
'update' => [],
];

/** @var AbstractEnumType $class */
foreach ($fsEnumTypes as $type => $class) {
$fsTypeValues = $class->getEnumValues();
if (in_array($type, $dbEnumTypes)) {
$dbTypeValues = $this->getDatabaseTypeValues($type);

Check warning on line 146 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 146 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 146 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration

Check warning on line 146 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter '$type' type is not compatible with declaration
if ($dbTypeValues === $fsTypeValues) {
$enumTypes['skip'][$type] = $fsTypeValues;
} else {
$enumTypes['update'][$type] = $fsTypeValues;
}
} else {
$enumTypes['create'][$type] = $fsTypeValues;
}
}

foreach ($dbEnumTypes as $type) {
if (! array_key_exists($type, $fsEnumTypes)) {
$enumTypes['delete'][$type] = $this->getDatabaseTypeValues($type);
}
}

return $enumTypes;
}

/**
* @param non-empty-string $type
* @param list<non-empty-string> $values
* @throws Exception
*/
private function createDatabaseType(string $type, array $values): void

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 171 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'
{
$this->connection->executeQuery(
sprintf("CREATE TYPE %s AS ENUM ('%s');", $type, implode("', '", $values))

Check warning on line 174 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf("CREATE TYPE %s AS ENUM ('%s');", $type, implode("', '", $values))' type is not compatible with declaration

Check warning on line 174 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf("CREATE TYPE %s AS ENUM ('%s');", $type, implode("', '", $values))' type is not compatible with declaration

Check warning on line 174 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf("CREATE TYPE %s AS ENUM ('%s');", $type, implode("', '", $values))' type is not compatible with declaration

Check warning on line 174 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf("CREATE TYPE %s AS ENUM ('%s');", $type, implode("', '", $values))' type is not compatible with declaration
);
}

/**
* @throws Exception
*/
private function deleteDatabaseType(string $type): void

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 181 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'
{
$this->connection->executeQuery(
sprintf('DROP TYPE %s;', $type)

Check warning on line 184 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf('DROP TYPE %s;', $type)' type is not compatible with declaration

Check warning on line 184 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf('DROP TYPE %s;', $type)' type is not compatible with declaration

Check warning on line 184 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf('DROP TYPE %s;', $type)' type is not compatible with declaration

Check warning on line 184 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Parameter type

Parameter 'sprintf('DROP TYPE %s;', $type)' type is not compatible with declaration
);
}

/**
* @param non-empty-string $type
* @param list<non-empty-string> $values
* @throws Exception
*/
private function updateDatabaseType(string $type, array $values): void

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'string'

Check warning on line 193 in src/Core/src/App/src/Doctrine/MigrationsMigratedSubscriber.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'void'
{
$this->deleteDatabaseType($type);
$this->createDatabaseType($type, $values);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SettingIdentifierEnumType extends AbstractEnumType
{
public const NAME = 'setting_enum';

protected function getEnumClass(): string
public function getEnumClass(): string
{
return SettingIdentifierEnum::class;
}
Expand Down
Loading