Skip to content

Chore(deps) - Doctrine major update #2861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6943080
Updated Doctrine to next major version
tarlepp Nov 2, 2024
622e150
Fixed Doctrine custom types
tarlepp Nov 2, 2024
5a8cdca
Removed obsolete use statement
tarlepp Nov 2, 2024
0a32a0f
Fixed sorting of attribute properties
tarlepp Nov 2, 2024
6434a8c
Refactored deprecated `ClassMetadataInfo` class usages
tarlepp Nov 3, 2024
8ae6fea
IDE settings
tarlepp Nov 3, 2024
3e36fe9
Fixed type issues from `dataProviderTestThatOneToManyAssociationMetho…
tarlepp Nov 3, 2024
cbff603
Fixed type issues from `dataProviderTestThatAssociationMethodsExists`…
tarlepp Nov 3, 2024
c984897
Fixed type issues from `dataProviderTestThatManyToOneAssociationMetho…
tarlepp Nov 3, 2024
054090c
Fixed type issues from `dataProviderTestThatManyToManyAssociationMeth…
tarlepp Nov 3, 2024
9a6b62c
Fixed deprecation issues from `ExceptionSubscriberTest` class
tarlepp Nov 3, 2024
8aebd29
Fixed repository service method variable type issues
tarlepp Nov 3, 2024
363600e
Fixed return type of `getAssociations` method
tarlepp Nov 3, 2024
1718db0
Changed parameter type definition to match with Doctrine
tarlepp Nov 3, 2024
61b9842
Fixed custom doctrine type exceptions
tarlepp Nov 3, 2024
f1b55d1
Suppress false positive Psalm issue
tarlepp Nov 3, 2024
afcc808
Removed obsolete use statement
tarlepp Nov 3, 2024
a185254
Fixed PHPStan type issues
tarlepp Nov 3, 2024
6b5e16a
Removed obsolete use statement
tarlepp Nov 3, 2024
a1276ac
Removed `JoinTable` attributes from non-owning side
tarlepp Nov 5, 2024
97b75f3
Separated fixture loading
tarlepp Nov 5, 2024
ee20903
Fixed `EntityTestCase` related tests
tarlepp Nov 9, 2024
84f4b62
Skip `StopwatchDecorator` tests temporary
tarlepp Nov 9, 2024
254bc62
Fixed type issues from `DateDimension` entity integration tests
tarlepp Nov 9, 2024
28370b8
Fixed type issues from `LogLoginFailure` entity integration tests
tarlepp Nov 9, 2024
a8d8b49
Fixed type issues from `DtoTestCase` class
tarlepp Nov 9, 2024
0cc0802
Fixed type issues from `PHPUnitUtilTest` class
tarlepp Nov 9, 2024
e59fb0d
Fixed type issues from `PHPUnitUtil` class
tarlepp Nov 9, 2024
bd448ad
Fixed code style issues
tarlepp Nov 9, 2024
220077a
Fixed issues that ECS tool reported
tarlepp Nov 9, 2024
b722114
Code cleanup
tarlepp Nov 9, 2024
a1135b2
Removed obsolete use statement
tarlepp Nov 9, 2024
6cac301
Fixed type issues that Psalm tool reported
tarlepp Nov 9, 2024
051fecd
Removed obsolete use statements
tarlepp Nov 9, 2024
c0cb7eb
Fixed mocking issues within `GenericRepositoryTest` integration class
tarlepp Nov 9, 2024
1dcb6fe
Fixed attribute name arguments order
tarlepp Nov 9, 2024
42e40e2
Skip `schemaInSyncWithMetadata` test
tarlepp Nov 9, 2024
a3d80d1
Restored `StopWatchDecorator` integration tests
tarlepp Nov 9, 2024
e3b7c5d
Updated composer lock files
tarlepp Nov 17, 2024
869f992
Try to use custom type
tarlepp Nov 17, 2024
380ac95
Fixed code style issue
tarlepp Nov 17, 2024
cd1315d
Removed obsolete use statement
tarlepp Nov 17, 2024
a0273ed
Added missing test class
tarlepp Nov 17, 2024
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
1 change: 0 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/symfony-flex-backend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ext-random": "*",
"doctrine/doctrine-bundle": "2.13.0",
"doctrine/doctrine-migrations-bundle": "3.3.1",
"doctrine/orm": "2.20.0",
"doctrine/orm": "3.3.0",
"friendsofphp/proxy-manager-lts": "1.0.18",
"gedmo/doctrine-extensions": "3.17.1",
"lexik/jwt-authentication-bundle": "3.1.0",
Expand Down
93 changes: 38 additions & 55 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ doctrine:
EnumLanguage: App\Doctrine\DBAL\Types\EnumLanguageType
EnumLocale: App\Doctrine\DBAL\Types\EnumLocaleType
EnumLogLogin: App\Doctrine\DBAL\Types\EnumLogLoginType
PrimaryString: App\Doctrine\DBAL\Types\PrimaryStringType
profiling_collect_backtrace: '%kernel.debug%'
#use_savepoints: true
# IMPORTANT: You MUST configure your server version,
Expand Down
16 changes: 3 additions & 13 deletions src/Doctrine/DBAL/Types/EnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use App\Enum\Interfaces\DatabaseEnumInterface;
use BackedEnum;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\Exception\InvalidFormat;
use Doctrine\DBAL\Types\Type;
use InvalidArgumentException;
use Override;
Expand All @@ -20,6 +20,7 @@
use function implode;
use function in_array;
use function is_string;
use function sprintf;

/**
* @package App\Doctrine\DBAL\Types
Expand Down Expand Up @@ -89,21 +90,10 @@ public function convertToPHPValue($value, AbstractPlatform $platform): DatabaseE
return $enum;
}

throw ConversionException::conversionFailedFormat(
throw InvalidFormat::new(
gettype($value),
static::$name,
'One of: "' . implode('", "', static::getValues()) . '"',
);
}

/**
* Parent method is deprecated, so remove this after it has been removed.
*
* @codeCoverageIgnore
*/
#[Override]
public function getName(): string
{
return '';
}
}
30 changes: 30 additions & 0 deletions src/Doctrine/DBAL/Types/PrimaryStringType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
declare(strict_types = 1);
/**
* /src/Doctrine/DBAL/Types/PrimaryStringType.php
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
*/

namespace App\Doctrine\DBAL\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\StringType;
use Override;

/**
* @package App\Doctrine\DBAL\Types
* @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
*/
class PrimaryStringType extends StringType
{
protected static string $name = Types::PRIMARY_STRING;

#[Override]
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
$column['length'] = 255;

return $platform->getStringTypeDeclarationSQL($column);
}
}
1 change: 1 addition & 0 deletions src/Doctrine/DBAL/Types/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ class Types
final public const string ENUM_LANGUAGE = 'EnumLanguage';
final public const string ENUM_LOCALE = 'EnumLocale';
final public const string ENUM_LOG_LOGIN = 'EnumLogLogin';
final public const string PRIMARY_STRING = 'PrimaryString';
}
8 changes: 4 additions & 4 deletions src/Doctrine/DBAL/Types/UTCDateTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
namespace App\Doctrine\DBAL\Types;

use DateTime;
use DateTimeInterface;
use DateTimeZone;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateTimeType;
use Doctrine\DBAL\Types\Exception\InvalidFormat;
use Override;

/**
Expand Down Expand Up @@ -45,15 +45,15 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): stri
/**
* @param T $value
*
* @return (T is null ? null : DateTimeInterface)
* @return (T is null ? null : DateTime)
*
* @template T
*
* @throws ConversionException
* @throws Exception
*/
#[Override]
public function convertToPHPValue($value, AbstractPlatform $platform): DateTimeInterface|null
public function convertToPHPValue($value, AbstractPlatform $platform): ?DateTime
{
if ($value instanceof DateTime) {
$value->setTimezone($this->getUtcDateTimeZone());
Expand Down Expand Up @@ -90,7 +90,7 @@ private function checkConvertedValue(string $value, AbstractPlatform $platform,
return $converted;
}

throw ConversionException::conversionFailedFormat(
throw InvalidFormat::new(
$value,
self::lookupName($this),
$platform->getDateTimeFormatString()
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class ApiKey implements EntityInterface, UserGroupAwareInterface
* @var Collection<int, LogRequest>|ArrayCollection<int, LogRequest>
*/
#[ORM\OneToMany(
mappedBy: 'apiKey',
targetEntity: LogRequest::class,
mappedBy: 'apiKey',
)]
#[Groups([
'ApiKey.logsRequest',
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/DateDimension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
name: 'date_dimension',
)]
#[ORM\Index(
name: 'date',
columns: [
'date',
],
name: 'date',
)]
#[ORM\ChangeTrackingPolicy('DEFERRED_EXPLICIT')]
class DateDimension implements EntityInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/LogLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
name: 'log_login',
)]
#[ORM\Index(
name: 'user_id',
columns: [
'user_id',
],
name: 'user_id',
)]
#[ORM\Index(
name: 'date',
columns: [
'date',
],
name: 'date',
)]
#[ORM\HasLifecycleCallbacks]
#[ORM\ChangeTrackingPolicy('DEFERRED_EXPLICIT')]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/LogLoginFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
name: 'log_login_failure',
)]
#[ORM\Index(
name: 'user_id',
columns: [
'user_id',
],
name: 'user_id',
)]
#[ORM\ChangeTrackingPolicy('DEFERRED_EXPLICIT')]
class LogLoginFailure implements EntityInterface
Expand Down
Loading
Loading