Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the readonly annotation #9340

Merged
merged 1 commit into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Cache/AssociationCacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
class AssociationCacheEntry implements CacheEntry
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var array<string, mixed> The entity identifier
*/
public $identifier;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string The entity class name
*/
public $class;
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Cache/CacheKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
abstract class CacheKey
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string Unique identifier
*/
public $hash;
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Cache/CollectionCacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
class CollectionCacheEntry implements CacheEntry
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var CacheKey[] The list of entity identifiers hold by the collection
*/
public $identifiers;
Expand Down
9 changes: 3 additions & 6 deletions lib/Doctrine/ORM/Cache/CollectionCacheKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,19 @@
class CollectionCacheKey extends CacheKey
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var array<string, mixed> The owner entity identifier
*/
public $ownerIdentifier;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string The owner entity class
*/
public $entityClass;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string The association name
*/
public $association;
Expand Down
6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Cache/EntityCacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
class EntityCacheEntry implements CacheEntry
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var array<string,mixed> The entity map data
*/
public $data;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string The entity class name
* @psalm-var class-string
*/
Expand Down
6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Cache/EntityCacheKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
class EntityCacheKey extends CacheKey
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var array<string, mixed> The entity identifier
*/
public $identifier;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var string The entity class name
*/
public $entityClass;
Expand Down
6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Cache/QueryCacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
class QueryCacheEntry implements CacheEntry
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var array<string, mixed> List of entity identifiers
*/
public $result;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var float Time creation of this cache entry
*/
public $time;
Expand Down
9 changes: 3 additions & 6 deletions lib/Doctrine/ORM/Cache/QueryCacheKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,22 @@
class QueryCacheKey extends CacheKey
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var int Cache key lifetime
*/
public $lifetime;

/**
* Cache mode
*
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var int
* @psalm-var Cache::MODE_*
*/
public $cacheMode;

/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var TimestampCacheKey|null
*/
public $timestampKey;
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Cache/TimestampCacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
class TimestampCacheEntry implements CacheEntry
{
/**
* READ-ONLY: Public only for performance reasons, it should be considered immutable.
*
* @readonly Public only for performance reasons, it should be considered immutable.
* @var float
*/
public $time;
Expand Down
9 changes: 3 additions & 6 deletions lib/Doctrine/ORM/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@
class Parser
{
/**
* READ-ONLY: Maps BUILT-IN string function names to AST class names.
*
* @readonly Maps BUILT-IN string function names to AST class names.
* @psalm-var array<string, class-string<Functions\FunctionNode>>
*/
private static $stringFunctions = [
Expand All @@ -101,8 +100,7 @@ class Parser
];

/**
* READ-ONLY: Maps BUILT-IN numeric function names to AST class names.
*
* @readonly Maps BUILT-IN numeric function names to AST class names.
* @psalm-var array<string, class-string<Functions\FunctionNode>>
*/
private static $numericFunctions = [
Expand All @@ -125,8 +123,7 @@ class Parser
];

/**
* READ-ONLY: Maps BUILT-IN datetime function names to AST class names.
*
* @readonly Maps BUILT-IN datetime function names to AST class names.
* @psalm-var array<string, class-string<Functions\FunctionNode>>
*/
private static $datetimeFunctions = [
Expand Down