Skip to content

Commit ddb3c74

Browse files
authored
Merge pull request doctrine#1887 from MatTheCat/datepoint-type
2 parents 6cd8bc2 + 2dab660 commit ddb3c74

File tree

12 files changed

+30
-32
lines changed

12 files changed

+30
-32
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ on:
1212
jobs:
1313
coding-standards:
1414
name: "Coding Standards"
15-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.2.2"
15+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.3.0"
1616
with:
1717
composer-options: "--prefer-dist --prefer-stable"

.github/workflows/composer-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ on:
1515
jobs:
1616
composer-lint:
1717
name: "Composer Lint"
18-
uses: "doctrine/.github/.github/workflows/composer-lint.yml@7.2.2"
18+
uses: "doctrine/.github/.github/workflows/composer-lint.yml@7.3.0"

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
documentation:
1919
name: "Documentation"
20-
uses: "doctrine/.github/.github/workflows/documentation.yml@7.2.2"
20+
uses: "doctrine/.github/.github/workflows/documentation.yml@7.3.0"

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@7.2.2"
11+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@7.3.0"
1212
secrets:
1313
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1414
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ on:
1212
jobs:
1313
static-analysis:
1414
name: "Static Analysis"
15-
uses: "doctrine/.github/.github/workflows/phpstan.yml@7.2.2"
15+
uses: "doctrine/.github/.github/workflows/phpstan.yml@7.3.0"

.github/workflows/test-dev-stability.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php-version:
19-
- "8.2"
19+
- "8.4"
2020
dependencies:
2121
- "highest"
2222
stability:
@@ -39,10 +39,6 @@ jobs:
3939
extensions: "pdo_sqlite"
4040
tools: "flex"
4141

42-
- name: "Require symfony/messenger"
43-
run: "composer require --dev symfony/messenger --no-update"
44-
if: "${{ startsWith(matrix.symfony-require, '4.') }}"
45-
4642
- name: "Install dependencies with Composer"
4743
uses: "ramsey/composer-install@v3"
4844
with:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
"require-dev": {
4646
"doctrine/annotations": "^1 || ^2",
4747
"doctrine/cache": "^1.11 || ^2.0",
48-
"doctrine/coding-standard": "^12",
48+
"doctrine/coding-standard": "^13",
4949
"doctrine/deprecations": "^1.0",
50-
"doctrine/orm": "^2.17 || ^3.0",
50+
"doctrine/orm": "^2.17 || ^3.1",
5151
"friendsofphp/proxy-manager-lts": "^1.0",
5252
"phpstan/phpstan": "2.1.1",
5353
"phpstan/phpstan-phpunit": "2.0.3",

docs/en/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ Configuration Reference
217217
proxy_namespace: Proxies
218218
# Enables the new implementation of proxies based on lazy ghosts instead of using the legacy implementation
219219
enable_lazy_ghost_objects: false
220+
identity_generation_preferences:
221+
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
220222
221223
entity_managers:
222224

src/DependencyInjection/DoctrineExtension.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
4040
use Doctrine\Persistence\Mapping\Driver\PHPDriver;
4141
use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver;
42-
use Doctrine\Persistence\Reflection\RuntimeReflectionProperty;
4342
use InvalidArgumentException;
4443
use LogicException;
4544
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
@@ -65,7 +64,7 @@
6564
use Symfony\Component\Messenger\MessageBusInterface;
6665
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
6766
use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;
68-
use Symfony\Component\VarExporter\LazyGhostTrait;
67+
use Symfony\Component\VarExporter\ProxyHelper;
6968

7069
use function array_intersect_key;
7170
use function array_keys;
@@ -77,7 +76,6 @@
7776
use function reset;
7877
use function sprintf;
7978
use function str_replace;
80-
use function trait_exists;
8179
use function trigger_deprecation;
8280

8381
/**
@@ -561,19 +559,12 @@ protected function ormLoad(array $config, ContainerBuilder $container)
561559
$container->setParameter('doctrine.default_entity_manager', $config['default_entity_manager']);
562560

563561
if ($config['enable_lazy_ghost_objects'] ?? false) {
564-
if (! trait_exists(LazyGhostTrait::class)) {
562+
if (! class_exists(ProxyHelper::class)) {
565563
throw new LogicException(
566564
'Lazy ghost objects cannot be enabled because the "symfony/var-exporter" library'
567565
. ' is not installed. Please run "composer require symfony/var-exporter".',
568566
);
569567
}
570-
571-
if (! class_exists(RuntimeReflectionProperty::class)) {
572-
throw new LogicException(
573-
'Lazy ghost objects cannot be enabled because the "doctrine/persistence" library'
574-
. ' version 3.1 or higher is not installed. Please run "composer update doctrine/persistence".',
575-
);
576-
}
577568
} elseif (! method_exists(ProxyFactory::class, 'resetUninitializedProxy')) {
578569
throw new LogicException(
579570
'Lazy ghost objects cannot be disabled for ORM 3.',

src/DoctrineBundle.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Doctrine\ORM\Proxy\Autoloader;
1717
use Doctrine\ORM\Proxy\DefaultProxyClassNameResolver;
1818
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass;
19+
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterDatePointTypePass;
1920
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
2021
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterUidTypePass;
2122
use Symfony\Bridge\Doctrine\DependencyInjection\Security\UserProvider\EntityFactory;
@@ -27,6 +28,7 @@
2728
use Symfony\Component\HttpKernel\Bundle\Bundle;
2829

2930
use function assert;
31+
use function class_exists;
3032
use function clearstatcache;
3133
use function dirname;
3234
use function spl_autoload_unregister;
@@ -36,8 +38,7 @@ class DoctrineBundle extends Bundle
3638
{
3739
private Closure|null $autoloader = null;
3840

39-
/** @return void */
40-
public function build(ContainerBuilder $container)
41+
public function build(ContainerBuilder $container): void
4142
{
4243
parent::build($container);
4344

@@ -73,10 +74,15 @@ public function process(ContainerBuilder $container): void
7374
$container->addCompilerPass(new RemoveLoggingMiddlewarePass());
7475
$container->addCompilerPass(new MiddlewaresPass());
7576
$container->addCompilerPass(new RegisterUidTypePass());
77+
78+
if (! class_exists(RegisterDatePointTypePass::class)) {
79+
return;
80+
}
81+
82+
$container->addCompilerPass(new RegisterDatePointTypePass());
7683
}
7784

78-
/** @return void */
79-
public function boot()
85+
public function boot(): void
8086
{
8187
// Register an autoloader for proxies to avoid issues when unserializing them
8288
// when the ORM is used.
@@ -124,8 +130,7 @@ public function boot()
124130
$this->autoloader = Autoloader::register($dir, $namespace, $proxyGenerator);
125131
}
126132

127-
/** @return void */
128-
public function shutdown()
133+
public function shutdown(): void
129134
{
130135
if ($this->autoloader !== null) {
131136
spl_autoload_unregister($this->autoloader);
@@ -157,8 +162,7 @@ public function shutdown()
157162
}
158163
}
159164

160-
/** @return void */
161-
public function registerCommands(Application $application)
165+
public function registerCommands(Application $application): void
162166
{
163167
}
164168

0 commit comments

Comments
 (0)