Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit16fccfa

Browse files
derrabusfabpot
authored andcommitted
[Cache] Deprecate DoctrineProvider
1 parent0e133be commit16fccfa

File tree

12 files changed

+41
-24
lines changed

12 files changed

+41
-24
lines changed

‎UPGRADE-5.4.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
UPGRADE FROM 5.3 to 5.4
22
=======================
33

4+
Cache
5+
-----
6+
7+
* Deprecate`DoctrineProvider` because this class has been added to the`doctrine/cache` package`
8+
49
FrameworkBundle
510
---------------
611

‎UPGRADE-6.0.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ DoctrineBridge
1111

1212
* Remove`UserLoaderInterface::loadUserByUsername()` in favor of`UserLoaderInterface::loadUserByIdentifier()`
1313

14+
Cache
15+
-----
16+
17+
* Remove`DoctrineProvider` because it has been added to the`doctrine/cache` package
18+
1419
Config
1520
------
1621

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"cache/integration-tests":"dev-master",
126126
"composer/package-versions-deprecated":"^1.8",
127127
"doctrine/annotations":"^1.12",
128-
"doctrine/cache":"^1.6|^2.0",
128+
"doctrine/cache":"^1.11|^2.0",
129129
"doctrine/collections":"~1.0",
130130
"doctrine/data-fixtures":"^1.1",
131131
"doctrine/dbal":"^2.10|^3.0",

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
useDoctrine\Common\Annotations\CachedReader;
1616
useDoctrine\Common\Annotations\PsrCachedReader;
1717
useDoctrine\Common\Annotations\Reader;
18+
useDoctrine\Common\Cache\Psr6\DoctrineProvider;
1819
useSymfony\Component\Cache\Adapter\ArrayAdapter;
1920
useSymfony\Component\Cache\Adapter\PhpArrayAdapter;
20-
useSymfony\Component\Cache\DoctrineProvider;
2121

2222
/**
2323
* Warms up annotation caches for classes found in composer's autoload class map
@@ -56,7 +56,7 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
5656
$annotatedClasses =include$annotatedClassPatterns;
5757
$reader =class_exists(PsrCachedReader::class)
5858
?newPsrCachedReader($this->annotationReader,$arrayAdapter,$this->debug)
59-
:newCachedReader($this->annotationReader,newDoctrineProvider($arrayAdapter),$this->debug)
59+
:newCachedReader($this->annotationReader, DoctrineProvider::wrap($arrayAdapter),$this->debug)
6060
;
6161

6262
foreach ($annotatedClassesas$class) {

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
useDoctrine\Common\Annotations\CachedReader;
1717
useDoctrine\Common\Annotations\PsrCachedReader;
1818
useDoctrine\Common\Annotations\Reader;
19+
useDoctrine\Common\Cache\Psr6\DoctrineProvider;
1920
useSymfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer;
2021
useSymfony\Component\Cache\Adapter\ArrayAdapter;
2122
useSymfony\Component\Cache\Adapter\FilesystemAdapter;
2223
useSymfony\Component\Cache\Adapter\PhpArrayAdapter;
23-
useSymfony\Component\Cache\DoctrineProvider;
2424

2525
returnstaticfunction (ContainerConfigurator$container) {
2626
$container->services()
@@ -36,9 +36,11 @@
3636
->set('annotations.cached_reader', CachedReader::class)
3737
->args([
3838
service('annotations.reader'),
39-
inline_service(DoctrineProvider::class)->args([
40-
inline_service(ArrayAdapter::class),
41-
]),
39+
inline_service(DoctrineProvider::class)
40+
->factory([DoctrineProvider::class,'wrap'])
41+
->args([
42+
inline_service(ArrayAdapter::class),
43+
]),
4244
abstract_arg('Debug-Flag'),
4345
])
4446

@@ -50,6 +52,7 @@
5052
])
5153

5254
->set('annotations.filesystem_cache', DoctrineProvider::class)
55+
->factory([DoctrineProvider::class,'wrap'])
5356
->args([
5457
service('annotations.filesystem_cache_adapter'),
5558
])
@@ -71,6 +74,7 @@
7174
->tag('container.hot_path')
7275

7376
->set('annotations.cache', DoctrineProvider::class)
77+
->factory([DoctrineProvider::class,'wrap'])
7478
->args([
7579
service('annotations.cache_adapter'),
7680
])

‎src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
useDoctrine\Common\Annotations\CachedReader;
77
useDoctrine\Common\Annotations\PsrCachedReader;
88
useDoctrine\Common\Annotations\Reader;
9+
useDoctrine\Common\Cache\Psr6\DoctrineProvider;
910
usePHPUnit\Framework\MockObject\MockObject;
1011
useSymfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer;
1112
useSymfony\Bundle\FrameworkBundle\Tests\TestCase;
1213
useSymfony\Component\Cache\Adapter\ArrayAdapter;
1314
useSymfony\Component\Cache\Adapter\NullAdapter;
1415
useSymfony\Component\Cache\Adapter\PhpArrayAdapter;
15-
useSymfony\Component\Cache\DoctrineProvider;
1616
useSymfony\Component\Filesystem\Filesystem;
1717

1818
class AnnotationsCacheWarmerTestextends TestCase
@@ -51,7 +51,7 @@ public function testAnnotationsCacheWarmerWithDebugDisabled()
5151
)
5252
:newCachedReader(
5353
$this->getReadOnlyReader(),
54-
newDoctrineProvider(newPhpArrayAdapter($cacheFile,newNullAdapter()))
54+
DoctrineProvider::wrap(newPhpArrayAdapter($cacheFile,newNullAdapter()))
5555
)
5656
;
5757
$refClass =new \ReflectionClass($this);
@@ -79,7 +79,7 @@ public function testAnnotationsCacheWarmerWithDebugEnabled()
7979
)
8080
:newCachedReader(
8181
$this->getReadOnlyReader(),
82-
newDoctrineProvider($phpArrayAdapter),
82+
DoctrineProvider::wrap($phpArrayAdapter),
8383
true
8484
)
8585
;

‎src/Symfony/Bundle/FrameworkBundle/composer.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"require-dev": {
3636
"doctrine/annotations":"^1.10.4",
37-
"doctrine/cache":"^1.0|^2.0",
37+
"doctrine/cache":"^1.11|^2.0",
3838
"doctrine/persistence":"^1.3|^2.0",
3939
"symfony/asset":"^5.3|^6.0",
4040
"symfony/browser-kit":"^5.4|^6.0",
@@ -70,6 +70,7 @@
7070
"symfony/phpunit-bridge":"^5.3|^6.0"
7171
},
7272
"conflict": {
73+
"doctrine/cache":"<1.11",
7374
"doctrine/persistence":"<1.3",
7475
"phpdocumentor/reflection-docblock":"<3.2.2",
7576
"phpdocumentor/type-resolver":"<1.4.0",

‎src/Symfony/Component/Cache/CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
5.4
5+
---
6+
7+
* Deprecate`DoctrineProvider` because this class has been added to the`doctrine/cache` package
8+
49
5.3
510
---
611

‎src/Symfony/Component/Cache/DoctrineProvider.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717

1818
/**
1919
* @author Nicolas Grekas <p@tchwork.com>
20+
*
21+
* @deprecated Use Doctrine\Common\Cache\Psr6\DoctrineProvider instead
2022
*/
2123
class DoctrineProviderextends CacheProviderimplements PruneableInterface, ResettableInterface
2224
{
2325
private$pool;
2426

2527
publicfunction__construct(CacheItemPoolInterface$pool)
2628
{
29+
trigger_deprecation('symfony/cache','5.4','"%s" is deprecated, use "Doctrine\Common\Cache\Psr6\DoctrineProvider" instead.');
30+
2731
$this->pool =$pool;
2832
}
2933

‎src/Symfony/Component/Cache/Tests/DoctrineProviderTest.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
useSymfony\Component\Cache\Adapter\ArrayAdapter;
1717
useSymfony\Component\Cache\DoctrineProvider;
1818

19+
/**
20+
* @group legacy
21+
*/
1922
class DoctrineProviderTestextends TestCase
2023
{
2124
publicfunctiontestProvider()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp