Skip to content

Commit

Permalink
Fix cs by hand
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Jan 30, 2021
1 parent 7f30cd3 commit 8f1911a
Show file tree
Hide file tree
Showing 114 changed files with 542 additions and 429 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,8 @@ public function toIterable(iterable $parameters = [], $hydrationMode = null): it
/**
* Executes the query.
*
* @param ArrayCollection|array|null $parameters Query parameters.
* @param string|int|null $hydrationMode Processing mode to be used during the hydration process.
* @param ArrayCollection|mixed[]|null $parameters Query parameters.
* @param string|int|null $hydrationMode Processing mode to be used during the hydration process.
*
* @return mixed
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Cache/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function buildCachedEntityPersister(EntityManagerInterface $em, EntityPer
*
* @param EntityManagerInterface $em The entity manager.
* @param CollectionPersister $persister The collection persister that will be cached.
* @param array $mapping The association mapping.
* @param mixed[] $mapping The association mapping.
*
* @return CachedCollectionPersister
*/
Expand Down Expand Up @@ -79,7 +79,7 @@ public function buildEntityHydrator(EntityManagerInterface $em, ClassMetadata $m
* Build a collection hydrator
*
* @param EntityManagerInterface $em The Entity manager.
* @param array $mapping The association mapping.
* @param mixed[] $mapping The association mapping.
*
* @return CollectionHydrator The built collection hydrator.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/CollectionHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface CollectionHydrator
/**
* @param ClassMetadata $metadata The entity metadata.
* @param CollectionCacheKey $key The cached collection key.
* @param array|Collection $collection The collection.
* @param mixed[]|Collection $collection The collection.
*
* @return CollectionCacheEntry
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DefaultCollectionHydrator implements CollectionHydrator
/** @var UnitOfWork */
private $uow;

/** @var array */
/** @var array<string,mixed> */
private static $hints = [Query::HINT_CACHE_ENABLED => true];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DefaultEntityHydrator implements EntityHydrator
*/
private $identifierFlattener;

/** @var array */
/** @var array<string,mixed> */
private static $hints = [Query::HINT_CACHE_ENABLED => true];

/**
Expand Down
9 changes: 5 additions & 4 deletions lib/Doctrine/ORM/Cache/DefaultQueryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DefaultQueryCache implements QueryCache
/** @var CacheLogger */
protected $cacheLogger;

/** @var array */
/** @var array<string,mixed> */
private static $hints = [Query::HINT_CACHE_ENABLED => true];

/**
Expand Down Expand Up @@ -304,7 +304,8 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h
// root entity association
if ($rootAlias === $parentAlias) {
// Cancel put result if association put fail
if (($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) {
$assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue);
if ($assocInfo === null) {
return false;
}

Expand Down Expand Up @@ -337,8 +338,8 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h
}

/**
* @param array $assoc
* @param mixed $assocValue
* @param array<string,mixed> $assoc
* @param mixed $assocValue
*
* @return mixed[]|null
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister
/** @var ClassMetadata */
protected $targetEntity;

/** @var array */
/** @var mixed[] */
protected $association;

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

/** @var Region */
Expand All @@ -79,7 +79,7 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister
* @param CollectionPersister $persister The collection persister that will be cached.
* @param Region $region The collection region.
* @param EntityManagerInterface $em The entity manager.
* @param array $association The association mapping.
* @param mixed[] $association The association mapping.
*/
public function __construct(CollectionPersister $persister, Region $region, EntityManagerInterface $em, array $association)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function loadCollectionCache(PersistentCollection $collection, Collection
/**
* Stores a collection into cache
*
* @param array|Collection $elements
* @param mixed[]|Collection $elements
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ReadWriteCachedCollectionPersister extends AbstractCollectionPersister
* @param CollectionPersister $persister The collection persister that will be cached.
* @param ConcurrentRegion $region The collection region.
* @param EntityManagerInterface $em The entity manager.
* @param array $association The association mapping.
* @param mixed[] $association The association mapping.
*/
public function __construct(CollectionPersister $persister, ConcurrentRegion $region, EntityManagerInterface $em, array $association)
{
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 array */
/** @var mixed[] */
protected $queuedCache = [];

/** @var Region */
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Cache/QueryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ interface QueryCache
public function clear();

/**
* @param mixed $result
* @param array $hints
* @param mixed $result
* @param mixed[] $hints
*
* @return bool
*/
public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $hints = []);

/**
* @param array $hints
* @param mixed[] $hints
*
* @return array|null
*/
Expand Down
14 changes: 3 additions & 11 deletions lib/Doctrine/ORM/Cache/Region/FileLockRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,13 @@ class FileLockRegion implements ConcurrentRegion
{
public const LOCK_EXTENSION = 'lock';

/**
* var \Doctrine\ORM\Cache\Region
*/
/** @var Region */
private $region;

/** @var string */
private $directory;

/**
* var integer
*/
/** @var int */
private $lockLifetime;

/**
Expand Down Expand Up @@ -267,10 +263,6 @@ public function unlock(CacheKey $key, Lock $lock)
return false;
}

if (! @unlink($this->getLockFileName($key))) {
return false;
}

return true;
return @unlink($this->getLockFileName($key));
}
}
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Cache/RegionsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
*/
class RegionsConfiguration
{
/** @var array */
/** @var array<string,int> */
private $lifetimes = [];

/** @var array */
/** @var array<string,int> */
private $lockLifetimes = [];

/** @var int */
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public function createQueryBuilder()
* If an entity is explicitly passed to this method only this entity and
* the cascade-persist semantics + scheduled inserts/removals are synchronized.
*
* @param object|array|null $entity
* @param object|mixed[]|null $entity
*
* @return void
*
Expand Down
14 changes: 8 additions & 6 deletions lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

use function array_slice;
use function lcfirst;
use function sprintf;
use function strpos;
use function substr;
use function trigger_error;
Expand Down Expand Up @@ -238,7 +239,7 @@ public function count(array $criteria)
* @return mixed The returned value from the resolved method.
*
* @throws ORMException
* @throws BadMethodCallException If the method called is invalid
* @throws BadMethodCallException If the method called is invalid.
*/
public function __call($method, $arguments)
{
Expand All @@ -254,10 +255,11 @@ public function __call($method, $arguments)
return $this->resolveMagicCall('count', substr($method, 7), $arguments);
}

throw new BadMethodCallException(
"Undefined method '$method'. The method name must start with " .
'either findBy, findOneBy or countBy!'
);
throw new BadMethodCallException(sprintf(
'Undefined method "%s". The method name must start with ' .
'either findBy, findOneBy or countBy!',
$method
));
}

/**
Expand Down Expand Up @@ -316,7 +318,7 @@ public function matching(Criteria $criteria)
*
* @return mixed
*
* @throws ORMException If the method called is invalid or the requested field/association does not exist
* @throws ORMException If the method called is invalid or the requested field/association does not exist.
*/
private function resolveMagicCall($method, $by, array $arguments)
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
*/
class PreUpdateEventArgs extends LifecycleEventArgs
{
/** @var array */
/** @var array<string,array<int,mixed>> */
private $entityChangeSet;

/**
* @param object $entity
* @param array $changeSet
* @param object $entity
* @param array<string,array<int,mixed>> $changeSet
*/
public function __construct($entity, EntityManagerInterface $em, array &$changeSet)
{
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ abstract protected function hydrateAllData();
* field names during this procedure as well as any necessary conversions on
* the values applied. Scalar values are kept in a specific key 'scalars'.
*
* @param array $data SQL Result Row.
* @param array &$id Dql-Alias => ID-Hash.
* @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value?
* @param mixed[] $data SQL Result Row.
* @param array &$id Dql-Alias => ID-Hash.
* @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value?
*
* @return array<string, array<string, mixed>> An array with all the fields
* (name => value) of the data
Expand Down Expand Up @@ -560,8 +560,8 @@ protected function getClassMetadata($className)
/**
* Register entity as managed in UnitOfWork.
*
* @param object $entity
* @param array $data
* @param object $entity
* @param mixed[] $data
*
* @return void
*
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
*/
class ArrayHydrator extends AbstractHydrator
{
/** @var array */
/** @var array<string,bool> */
private $_rootAliases = [];

/** @var bool */
private $_isSimpleQuery = false;

/** @var array */
/** @var mixed[] */
private $_identifierMap = [];

/** @var array */
/** @var mixed[] */
private $_resultPointers = [];

/** @var array */
/** @var array<string,string> */
private $_idTemplate = [];

/** @var int */
Expand Down Expand Up @@ -259,7 +259,7 @@ protected function hydrateRowData(array $row, array &$result)
* Updates the result pointer for an Entity. The result pointers point to the
* last seen instance of each Entity type. This is used for graph construction.
*
* @param array $coll The element.
* @param mixed[] $coll The element.
* @param bool|int $index Index of the element in the collection.
* @param string $dqlAlias
* @param bool $oneToOne Whether it is a single-valued association or not.
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@
*/
class ObjectHydrator extends AbstractHydrator
{
/** @var array */
/** @var mixed[] */
private $identifierMap = [];

/** @var array */
/** @var mixed[] */
private $resultPointers = [];

/** @var array */
/** @var mixed[] */
private $idTemplate = [];

/** @var int */
private $resultCounter = 0;

/** @var array */
/** @var mixed[] */
private $rootAliases = [];

/** @var array */
/** @var mixed[] */
private $initializedCollections = [];

/** @var array */
/** @var mixed[] */
private $existingCollections = [];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class HydrationCompleteHandler
/** @var EntityManagerInterface */
private $em;

/** @var array[] */
/** @var mixed[][] */
private $deferredPostLoadInvocations = [];

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ class AssociationBuilder
/** @var ClassMetadataBuilder */
protected $builder;

/** @var array */
/** @var mixed[] */
protected $mapping;

/** @var array|null */
/** @var mixed[]|null */
protected $joinColumns;

/** @var int */
protected $type;

/**
* @param array $mapping
* @param int $type
* @param mixed[] $mapping
* @param int $type
*/
public function __construct(ClassMetadataBuilder $builder, array $mapping, $type)
{
Expand Down
Loading

0 comments on commit 8f1911a

Please sign in to comment.