Skip to content

Commit f9f453f

Browse files
authored
Use the readonly annotation (#9340)
1 parent 1e97742 commit f9f453f

File tree

10 files changed

+20
-40
lines changed

10 files changed

+20
-40
lines changed

lib/Doctrine/ORM/Cache/AssociationCacheEntry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
class AssociationCacheEntry implements CacheEntry
1111
{
1212
/**
13-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
14-
*
13+
* @readonly Public only for performance reasons, it should be considered immutable.
1514
* @var array<string, mixed> The entity identifier
1615
*/
1716
public $identifier;
1817

1918
/**
20-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
21-
*
19+
* @readonly Public only for performance reasons, it should be considered immutable.
2220
* @var string The entity class name
2321
*/
2422
public $class;

lib/Doctrine/ORM/Cache/CacheKey.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
abstract class CacheKey
1212
{
1313
/**
14-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
15-
*
14+
* @readonly Public only for performance reasons, it should be considered immutable.
1615
* @var string Unique identifier
1716
*/
1817
public $hash;

lib/Doctrine/ORM/Cache/CollectionCacheEntry.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
class CollectionCacheEntry implements CacheEntry
1111
{
1212
/**
13-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
14-
*
13+
* @readonly Public only for performance reasons, it should be considered immutable.
1514
* @var CacheKey[] The list of entity identifiers hold by the collection
1615
*/
1716
public $identifiers;

lib/Doctrine/ORM/Cache/CollectionCacheKey.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@
1515
class CollectionCacheKey extends CacheKey
1616
{
1717
/**
18-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
19-
*
18+
* @readonly Public only for performance reasons, it should be considered immutable.
2019
* @var array<string, mixed> The owner entity identifier
2120
*/
2221
public $ownerIdentifier;
2322

2423
/**
25-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
26-
*
24+
* @readonly Public only for performance reasons, it should be considered immutable.
2725
* @var string The owner entity class
2826
*/
2927
public $entityClass;
3028

3129
/**
32-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
33-
*
30+
* @readonly Public only for performance reasons, it should be considered immutable.
3431
* @var string The association name
3532
*/
3633
public $association;

lib/Doctrine/ORM/Cache/EntityCacheEntry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414
class EntityCacheEntry implements CacheEntry
1515
{
1616
/**
17-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
18-
*
17+
* @readonly Public only for performance reasons, it should be considered immutable.
1918
* @var array<string,mixed> The entity map data
2019
*/
2120
public $data;
2221

2322
/**
24-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
25-
*
23+
* @readonly Public only for performance reasons, it should be considered immutable.
2624
* @var string The entity class name
2725
* @psalm-var class-string
2826
*/

lib/Doctrine/ORM/Cache/EntityCacheKey.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
class EntityCacheKey extends CacheKey
1616
{
1717
/**
18-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
19-
*
18+
* @readonly Public only for performance reasons, it should be considered immutable.
2019
* @var array<string, mixed> The entity identifier
2120
*/
2221
public $identifier;
2322

2423
/**
25-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
26-
*
24+
* @readonly Public only for performance reasons, it should be considered immutable.
2725
* @var string The entity class name
2826
*/
2927
public $entityClass;

lib/Doctrine/ORM/Cache/QueryCacheEntry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212
class QueryCacheEntry implements CacheEntry
1313
{
1414
/**
15-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
16-
*
15+
* @readonly Public only for performance reasons, it should be considered immutable.
1716
* @var array<string, mixed> List of entity identifiers
1817
*/
1918
public $result;
2019

2120
/**
22-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
23-
*
21+
* @readonly Public only for performance reasons, it should be considered immutable.
2422
* @var float Time creation of this cache entry
2523
*/
2624
public $time;

lib/Doctrine/ORM/Cache/QueryCacheKey.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,22 @@
1212
class QueryCacheKey extends CacheKey
1313
{
1414
/**
15-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
16-
*
15+
* @readonly Public only for performance reasons, it should be considered immutable.
1716
* @var int Cache key lifetime
1817
*/
1918
public $lifetime;
2019

2120
/**
2221
* Cache mode
2322
*
24-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
25-
*
23+
* @readonly Public only for performance reasons, it should be considered immutable.
2624
* @var int
2725
* @psalm-var Cache::MODE_*
2826
*/
2927
public $cacheMode;
3028

3129
/**
32-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
33-
*
30+
* @readonly Public only for performance reasons, it should be considered immutable.
3431
* @var TimestampCacheKey|null
3532
*/
3633
public $timestampKey;

lib/Doctrine/ORM/Cache/TimestampCacheEntry.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
class TimestampCacheEntry implements CacheEntry
1313
{
1414
/**
15-
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
16-
*
15+
* @readonly Public only for performance reasons, it should be considered immutable.
1716
* @var float
1817
*/
1918
public $time;

lib/Doctrine/ORM/Query/Parser.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@
8787
class Parser
8888
{
8989
/**
90-
* READ-ONLY: Maps BUILT-IN string function names to AST class names.
91-
*
90+
* @readonly Maps BUILT-IN string function names to AST class names.
9291
* @psalm-var array<string, class-string<Functions\FunctionNode>>
9392
*/
9493
private static $stringFunctions = [
@@ -101,8 +100,7 @@ class Parser
101100
];
102101

103102
/**
104-
* READ-ONLY: Maps BUILT-IN numeric function names to AST class names.
105-
*
103+
* @readonly Maps BUILT-IN numeric function names to AST class names.
106104
* @psalm-var array<string, class-string<Functions\FunctionNode>>
107105
*/
108106
private static $numericFunctions = [
@@ -125,8 +123,7 @@ class Parser
125123
];
126124

127125
/**
128-
* READ-ONLY: Maps BUILT-IN datetime function names to AST class names.
129-
*
126+
* @readonly Maps BUILT-IN datetime function names to AST class names.
130127
* @psalm-var array<string, class-string<Functions\FunctionNode>>
131128
*/
132129
private static $datetimeFunctions = [

0 commit comments

Comments
 (0)