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

Commitc4c35d0

Browse files
committed
[Cache] Deprecate DoctrineProvider
1 parentba2a354 commitc4c35d0

File tree

13 files changed

+60
-16
lines changed

13 files changed

+60
-16
lines changed

‎UPGRADE-5.4.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
UPGRADE FROM 5.3 to 5.4
2+
=======================
3+
4+
Cache
5+
-----
6+
7+
* Deprecate`DoctrineProvider` because this class has been added to the`doctrine/cache` package`

‎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",
128+
"doctrine/cache":"^1.11",
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
@@ -59,7 +59,7 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
5959
// doctrine/annotations:1.13 and above
6060
$reader =newPsrCachedReader($this->annotationReader,$arrayAdapter,$this->debug);
6161
}else {
62-
$reader =newCachedReader($this->annotationReader,newDoctrineProvider($arrayAdapter),$this->debug);
62+
$reader =newCachedReader($this->annotationReader, DoctrineProvider::wrap($arrayAdapter),$this->debug);
6363
}
6464

6565
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
])
@@ -63,6 +66,7 @@
6366
])
6467

6568
->set('annotations.cache', DoctrineProvider::class)
69+
->factory([DoctrineProvider::class,'wrap'])
6670
->args([
6771
inline_service(PhpArrayAdapter::class)
6872
->factory([PhpArrayAdapter::class,'create'])

‎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
@@ -48,7 +48,7 @@ public function testAnnotationsCacheWarmerWithDebugDisabled()
4848
if (class_exists(PsrCachedReader::class)) {
4949
$reader =newPsrCachedReader($this->getReadOnlyReader(),$psr6Cache);
5050
}else {
51-
$reader =newCachedReader($this->getReadOnlyReader(),newDoctrineProvider($psr6Cache));
51+
$reader =newCachedReader($this->getReadOnlyReader(), DoctrineProvider::wrap($psr6Cache));
5252
}
5353

5454
$refClass =new \ReflectionClass($this);
@@ -71,7 +71,7 @@ public function testAnnotationsCacheWarmerWithDebugEnabled()
7171
if (class_exists(PsrCachedReader::class)) {
7272
$reader =newPsrCachedReader($this->getReadOnlyReader(),$psr6Cache);
7373
}else {
74-
$reader =newCachedReader($this->getReadOnlyReader(),newDoctrineProvider($psr6Cache));
74+
$reader =newCachedReader($this->getReadOnlyReader(), DoctrineProvider::wrap($psr6Cache));
7575
}
7676

7777
$refClass =new \ReflectionClass($this);

‎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",
37+
"doctrine/cache":"^1.11",
3838
"doctrine/persistence":"^1.3|^2.0",
3939
"symfony/asset":"^5.3",
4040
"symfony/browser-kit":"^4.4|^5.0",
@@ -102,6 +102,7 @@
102102
"symfony/phpunit-bridge":"^5.3"
103103
},
104104
"conflict": {
105+
"doctrine/cache":"<1.11",
105106
"doctrine/persistence":"<1.3",
106107
"phpdocumentor/reflection-docblock":"<3.2.2",
107108
"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