Skip to content

Commit e8b5b67

Browse files
committed
doctrine
1 parent 6e00ef6 commit e8b5b67

File tree

8 files changed

+43
-80
lines changed

8 files changed

+43
-80
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"doctrine/cache": "^1.11 || ^2.1",
130130
"doctrine/common": "^3.2.2",
131131
"doctrine/dbal": "^4.0",
132-
"doctrine/doctrine-bundle": "^2.11",
132+
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
133133
"doctrine/mongodb-odm": "^2.10",
134134
"doctrine/mongodb-odm-bundle": "^5.0",
135135
"doctrine/orm": "^2.17 || ^3.0",
@@ -219,5 +219,6 @@
219219
"type": "library",
220220
"repositories": [
221221
{"type": "vcs", "url": "https://github.com/soyuka/phpunit"}
222-
]
222+
],
223+
"minimum-stability": "dev"
223224
}

src/Doctrine/Odm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"symfony/type-info": "^7.3 || ^8.0"
3434
},
3535
"require-dev": {
36-
"doctrine/doctrine-bundle": "^2.11",
36+
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
3737
"doctrine/mongodb-odm-bundle": "^5.0",
3838
"phpspec/prophecy-phpunit": "^2.2",
3939
"phpunit/phpunit": "11.5.x-dev",

src/Doctrine/Orm/Tests/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ doctrine:
1111
controller_resolver:
1212
enabled: false
1313
auto_mapping: false
14-
enable_lazy_ghost_objects: true
1514
mappings:
1615
ApiPlatform\Doctrine\Orm\Tests\Fixtures\Entity:
1716
type: attribute

src/Doctrine/Orm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"symfony/type-info": "^7.3 || ^8.0"
3232
},
3333
"require-dev": {
34-
"doctrine/doctrine-bundle": "^2.11",
34+
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
3535
"phpspec/prophecy-phpunit": "^2.2",
3636
"phpunit/phpunit": "11.5.x-dev",
3737
"ramsey/uuid": "^4.7",

src/Hydra/State/JsonStreamerProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
4242
$data = $this->jsonStreamReader->read($request->getContent(true), Type::object($operation->getClass()));
4343
$context['request']->attributes->set('deserialized', true);
4444

45-
if (\PHP_VERSION_ID > 80400) {
46-
$refl = new \ReflectionClass($data);
47-
if ($refl->isUninitializedLazyObject($data)) {
48-
$refl->initializeLazyObject($data);
49-
}
50-
}
45+
// if (\PHP_VERSION_ID > 80400) {
46+
// $refl = new \ReflectionClass($data);
47+
// if ($refl->isUninitializedLazyObject($data)) {
48+
// $refl->initializeLazyObject($data);
49+
// }
50+
// }
5151

5252
return $data;
5353
}

tests/Fixtures/app/AppKernel.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
2727
use Doctrine\Bundle\MongoDBBundle\Command\TailCursorDoctrineODMCommand;
2828
use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
29+
use Doctrine\Bundle\DoctrineBundle\Command\Proxy\ValidateSchemaCommand;
2930
use FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle;
3031
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
3132
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
@@ -44,6 +45,7 @@
4445
use Symfony\Component\Security\Core\Authorization\Strategy\AccessDecisionStrategyInterface;
4546
use Symfony\Component\Security\Core\User\User as SymfonyCoreUser;
4647
use Symfony\Component\Security\Core\User\UserInterface;
48+
use Symfony\Component\PropertyInfo\Type;
4749

4850
/**
4951
* AppKernel for tests.
@@ -160,6 +162,12 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
160162
];
161163
}
162164

165+
// SF 8.1 removed configuration
166+
if (!class_exists(Type::class)) {
167+
unset($config['annotations']);
168+
$c->setParameter('.json_streamer.lazy_ghosts_dir', __DIR__ . '/cache/json_streamer_lazy_ghost');
169+
}
170+
163171
$c->prependExtensionConfig('framework', $config);
164172

165173
$alg = class_exists(NativePasswordHasher::class, false) || class_exists('Symfony\Component\Security\Core\Encoder\NativePasswordEncoder') ? 'auto' : 'bcrypt';
@@ -281,11 +289,19 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
281289
if (defined(ConnectionFactory::class.'::DEFAULT_SCHEME_MAP')) {
282290
$c->prependExtensionConfig('doctrine', [
283291
'orm' => [
284-
'report_fields_where_declared' => true,
285292
'controller_resolver' => ['auto_mapping' => false],
286-
'enable_lazy_ghost_objects' => true,
287293
],
288294
]);
295+
296+
if (class_exists(ValidateSchemaCommand::class)) {
297+
$c->prependExtensionConfig('doctrine', [
298+
'orm' => [
299+
'auto_generate_proxy_classes' => '%kernel.debug%',
300+
'report_fields_where_declared' => true,
301+
'enable_lazy_ghost_objects' => true,
302+
],
303+
]);
304+
}
289305
}
290306

291307
$loader->load(__DIR__.'/config/config_swagger.php');

tests/Fixtures/app/config/config_common.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ doctrine:
1313
symfony_uuid: Symfony\Bridge\Doctrine\Types\UuidType
1414

1515
orm:
16-
auto_generate_proxy_classes: '%kernel.debug%'
1716
mappings:
1817
TestBundle:
1918
type: 'attribute'

0 commit comments

Comments
 (0)