8000 Backport slamdunk's work by greg0ire · Pull Request #8793 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Backport slamdunk's work #8793

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

Merged
merged 4 commits into from
Jun 27, 2021
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
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Cache/DefaultCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ public function getQueryCache($regionName = null)
return $this->queryCaches[$regionName];
}

/**
* @param ClassMetadata $metadata The entity metadata.
* @param mixed $identifier The entity identifier.
*/
/**
* @param ClassMetadata $metadata The entity metadata.
* @param mixed $identifier The entity identifier.
*/
private function buildEntityCacheKey(ClassMetadata $metadata, $identifier): EntityCacheKey
{
if (! is_array($identifier)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/DefaultQueryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
class DefaultQueryCache implements QueryCache
{
/** @var EntityManagerInterface */
/** @var EntityManagerInterface */
private $em;

/** @var UnitOfWork */
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Lock
public function __construct($value, $time = null)
{
$this->value = $value;
$this->time = $time ? : time();
$this->time = $time ?: time();
}

/**
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ORM/Cache/Logging/CacheLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public function entityCacheHit($regionName, EntityCacheKey $key);
*/
public function entityCacheMiss($regionName, EntityCacheKey $key);

/**
* Log an entity put into second level cache.
*
* @param string $regionName The name of the cache region.
* @param CollectionCacheKey $key The cache key of the collection.
*/
/**
* Log an entity put into second level cache.
*
* @param string $regionName The name of the cache region.
* @param CollectionCacheKey $key The cache key of the collection.
*/
public function collectionCachePut($regionName, CollectionCacheKey $key);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

abstract class AbstractCollectionPersister implements CachedCollectionPersister
{
/** @var UnitOfWork */
/** @var UnitOfWork */
protected $uow;

/** @var ClassMetadataFactory */
Expand All @@ -60,7 +60,7 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister
/** @var mixed[] */
protected $association;

/** @var mixed[] */
/** @var mixed[] */
protected $queuedCache = [];

/** @var Region */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
/** @var ClassMetadata */
protected $class;

/** @var mixed[] */
/** @var mixed[] */
protected $queuedCache = [];

/** @var Region */
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ class QueryBuilder
*/
private $joinRootAliases = [];

/**
* Whether to use second level cache, if available.
*
* @var bool
*/
/**
* Whether to use second level cache, if available.
*
* @var bool
*/
protected $cacheable = false;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function configure()
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear a second-level cache collection regions for an associated Entity Manager.
It is possible to delete/invalidate all collection region, a specific collection region or flushes the cache provider.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function configure()
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear a second-level cache entity region for an associated Entity Manager.
It is possible to delete/invalidate all entity region, a specific entity region or flushes the cache provider.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function configure()
->setDescription('Clear all metadata cache of the various cache drivers')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear the metadata cache of associated Entity Manager.
EOT
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure()
->setDescription('Clear all query cache of the various cache drivers')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear the query cache of associated Entity Manager.
It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider
instance completely.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure()
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all query regions will be deleted/invalidated.')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear a second-level cache query region for an associated Entity Manager.
It is possible to delete/invalidate all query region, a specific query region or flushes the cache provider.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure()
->setDescription('Clear all result cache of the various cache drivers')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command is meant to clear the result cache of associated Entity Manager.
It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider
instance completely.
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure()
$this->setName('orm:info')
->setDescription('Show basic information about all mapped entities')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> shows basic information about which
entities exist and possibly if their mapping information contains errors or
not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function configure(): void
->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity')
->setDescription('Display information about mapped objects')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The %command.full_name% command describes the metadata for the given full or partial entity class name.

<info>%command.full_name%</info> My\Namespace\Entity\MyEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ protected function configure()
->setDescription('Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'Name of the entity manager to operate on')
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.

<comment>Hint:</comment> If you have a database with tables that should not be managed
by the ORM, you can use a DBAL functionality to filter the tables and sequences down
on a global level:

\$config->setFilterSchemaAssetsExpression(\$regexp);
$config->setFilterSchemaAssetsExpression($regexp);
EOT
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ protected function configure()
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.')
->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run.")
->addOption('full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output.
Beware that the complete database is dropped by this command, even tables that are not relevant to your metadata model.

<comment>Hint:</comment> If you have a database with tables that should not be managed
by the ORM, you can use a DBAL functionality to filter the tables and sequences down
on a global level:

\$config->setFilterSchemaAssetsExpression(\$regexp);
$config->setFilterSchemaAssetsExpression($regexp);
EOT
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function configure()
->addOption('complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.')
->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>%command.name%</info> command generates the SQL needed to
synchronize the database schema with the current mapping metadata of the
default entity manager.
Expand Down Expand Up @@ -79,7 +79,7 @@ protected function configure()
by the ORM, you can use a DBAL functionality to filter the tables and sequences down
on a global level:

\$config->setFilterSchemaAssetsExpression(\$regexp);
$config->setFilterSchemaAssetsExpression($regexp);
EOT
);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Doctrine/Tests/Models/Company/CompanyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
*/
abstract class CompanyEvent
{
/**
* @var int
* @Id
* @Column(type="integer")
* @GeneratedValue
*/
/**
* @var int
* @Id
* @Column(type="integer")
* @GeneratedValue
*/
private $id;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* name = "guest_name",
* nullable = false,
* unique = true,
length = 240
* length = 240
* )
* )
* })
Expand Down
0