Skip to content

Commit

Permalink
Merge pull request #8548 from orklah/test2
Browse files Browse the repository at this point in the history
Adding details to types in PHPDoc
  • Loading branch information
greg0ire committed Apr 18, 2021
2 parents ce128e7 + dc37c2c commit b04d7a6
Show file tree
Hide file tree
Showing 57 changed files with 311 additions and 154 deletions.
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ public function free()
* Get all defined parameters.
*
* @return ArrayCollection The defined query parameters.
* @psalm-return ArrayCollection<int, Parameter>
*/
public function getParameters()
{
Expand All @@ -323,7 +324,7 @@ public function getParameters()
*
* @param mixed $key The key (index or name) of the bound parameter.
*
* @return Query\Parameter|null The value of the bound parameter, or NULL if not available.
* @return Parameter|null The value of the bound parameter, or NULL if not available.
*/
public function getParameter($key)
{
Expand Down
9 changes: 9 additions & 0 deletions lib/Doctrine/ORM/Cache/CacheConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public function getCacheLogger()
return $this->cacheLogger;
}

/**
* @return void
*/
public function setCacheLogger(CacheLogger $logger)
{
$this->cacheLogger = $logger;
Expand All @@ -80,6 +83,9 @@ public function getRegionsConfiguration()
return $this->regionsConfig;
}

/**
* @return void
*/
public function setRegionsConfiguration(RegionsConfiguration $regionsConfig)
{
$this->regionsConfig = $regionsConfig;
Expand All @@ -99,6 +105,9 @@ public function getQueryValidator()
return $this->queryValidator;
}

/**
* @return void
*/
public function setQueryValidator(QueryCacheValidator $validator)
{
$this->queryValidator = $validator;
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/Cache/DefaultCacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public function __construct(RegionsConfiguration $cacheConfig, CacheAdapter $cac

/**
* @param string $fileLockRegionDirectory
*
* @return void
*/
public function setFileLockRegionDirectory($fileLockRegionDirectory)
{
Expand All @@ -84,11 +86,17 @@ public function getFileLockRegionDirectory()
return $this->fileLockRegionDirectory;
}

/**
* @return void
*/
public function setRegion(Region $region)
{
$this->regions[$region->getName()] = $region;
}

/**
* @return void
*/
public function setTimestampRegion(TimestampRegion $region)
{
$this->timestampRegion = $region;
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 @@ -345,7 +345,7 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h
* @param mixed $assocValue
*
* @return mixed[]|null
* @psalm-return array{targetEntity: string, type: mixed, list?: array[], identifier?: array}|null
* @psalm-return array{targetEntity: class-string, type: mixed, list?: array[], identifier?: array}|null
*/
private function storeAssociationCache(QueryCacheKey $key, array $assoc, $assocValue)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Cache/Logging/CacheLoggerChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CacheLoggerChain implements CacheLogger

/**
* @param string $name
*
* @return void
*/
public function setLogger($name, CacheLogger $logger)
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public function getRegionsPut()
* Clear region statistics
*
* @param string $regionName The name of the cache region.
*
* @return void
*/
public function clearRegionStats($regionName)
{
Expand All @@ -204,6 +206,8 @@ public function clearRegionStats($regionName)

/**
* Clear all statistics
*
* @return void
*/
public function clearStats()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri

/**
* Clears cache entries related to the current collection
*
* @return void
*/
protected function evictCollectionCache(PersistentCollection $collection)
{
Expand All @@ -258,6 +260,8 @@ protected function evictCollectionCache(PersistentCollection $collection)
/**
* @param string $targetEntity
* @param object $element
*
* @return void
*/
protected function evictElementCache($targetEntity, $element)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ public function storeEntityCache($entity, EntityCacheKey $key)

/**
* @param object $entity
*
* @return void
*/
private function storeJoinedAssociations($entity)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Cache/Region/FileLockRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private function getLockFileName(CacheKey $key)
/**
* @param string $filename
*
* @return string
* @return false|string
*/
private function getLockContent($filename)
{
Expand All @@ -138,7 +138,7 @@ private function getLockContent($filename)
/**
* @param string $filename
*
* @return int
* @return false|int
*/
private function getLockTime($filename)
{
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/Cache/RegionsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function getDefaultLifetime()

/**
* @param int $defaultLifetime
*
* @return void
*/
public function setDefaultLifetime($defaultLifetime)
{
Expand All @@ -73,6 +75,8 @@ public function getDefaultLockLifetime()

/**
* @param int $defaultLockLifetime
*
* @return void
*/
public function setDefaultLockLifetime($defaultLockLifetime)
{
Expand All @@ -92,6 +96,8 @@ public function getLifetime($regionName)
/**
* @param string $name
* @param int $lifetime
*
* @return void
*/
public function setLifetime($name, $lifetime)
{
Expand All @@ -111,6 +117,8 @@ public function getLockLifetime($regionName)
/**
* @param string $name
* @param int $lifetime
*
* @return void
*/
public function setLockLifetime($name, $lifetime)
{
Expand Down
10 changes: 10 additions & 0 deletions lib/Doctrine/ORM/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ public function getClassMetadataFactoryName()
*
* @param string $name The name of the filter.
* @param string $className The class name of the filter.
*
* @return void
*/
public function addFilter($name, $className)
{
Expand Down Expand Up @@ -733,6 +735,8 @@ public function getQuoteStrategy()

/**
* Set the entity listener resolver.
*
* @return void
*/
public function setEntityListenerResolver(EntityListenerResolver $resolver)
{
Expand All @@ -755,6 +759,8 @@ public function getEntityListenerResolver()

/**
* Set the entity repository factory.
*
* @return void
*/
public function setRepositoryFactory(RepositoryFactory $repositoryFactory)
{
Expand Down Expand Up @@ -823,6 +829,8 @@ public function getDefaultQueryHints()
* Sets array of query hints, which will be applied to every query in application
*
* @psalm-param array<string, mixed> $defaultQueryHints
*
* @return void
*/
public function setDefaultQueryHints(array $defaultQueryHints)
{
Expand All @@ -846,6 +854,8 @@ public function getDefaultQueryHint($name)
*
* @param string $name The name of the hint.
* @param mixed $value The value of the hint.
*
* @return void
*/
public function setDefaultQueryHint($name, $value)
{
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ protected function getClassMetadata()
* Select all elements from a selectable that match the expression and
* return a new collection containing these elements.
*
* @return LazyCriteriaCollection
* @psalm-return Collection<int, T>
*/
public function matching(Criteria $criteria)
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Event/ListenersInvoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function getSubscribedSystems(ClassMetadata $metadata, $eventName)
* @param object $entity The Entity on which the event occurred.
* @param EventArgs $event The Event args.
* @param int $invoke Bitmask to invoke listeners.
*
* @return void
*/
public function invoke(ClassMetadata $metadata, $eventName, $entity, EventArgs $event, $invoke)
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function __construct($className, ObjectManager $objectManager)
parent::__construct($objectManager);
}

/**
* @return void
*/
public function setFoundMetadata(?ClassMetadata $classMetadata = null)
{
$this->foundMetadata = $classMetadata;
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Event/OnClearEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace Doctrine\ORM\Event;

use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;

/**
Expand Down Expand Up @@ -49,7 +48,7 @@ public function __construct(EntityManagerInterface $em, $entityClass = null)
/**
* Retrieves associated EntityManager.
*
* @return EntityManager
* @return EntityManagerInterface
*/
public function getEntityManager()
{
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ORM/Event/OnFlushEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace Doctrine\ORM\Event;

use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;

/**
Expand All @@ -42,7 +41,7 @@ public function __construct(EntityManagerInterface $em)
/**
* Retrieve associated EntityManager.
*
* @return EntityManager
* @return EntityManagerInterface
*/
public function getEntityManager()
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public function sort()
* {@internal Highly performance-sensitive method.}
*
* @param stdClass $vertex
*
* @return void
*/
private function visit($vertex)
{
Expand Down
6 changes: 4 additions & 2 deletions lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\Tools\Pagination\LimitSubqueryWalker;
use Doctrine\ORM\UnitOfWork;
use Generator;
use PDO;
use ReflectionClass;

Expand Down Expand Up @@ -152,7 +153,7 @@ public function iterate($stmt, $resultSetMapping, array $hints = [])
*
* @psalm-param array<string, mixed> $hints
*
* @return iterable<mixed>
* @return Generator<int, mixed>
*/
public function toIterable(ResultStatement $stmt, ResultSetMapping $resultSetMapping, array $hints = []): iterable
{
Expand Down Expand Up @@ -220,7 +221,7 @@ public function hydrateAll($stmt, $resultSetMapping, array $hints = [])
* Hydrates a single row returned by the current statement instance during
* row-by-row hydration with {@link iterate()} or {@link toIterable()}.
*
* @return mixed
* @return mixed[]|false
*/
public function hydrateRow()
{
Expand Down Expand Up @@ -539,6 +540,7 @@ protected function hydrateColumnInfo($key)

/**
* @return string[]
* @psalm-return non-empty-list<string>
*/
private function getDiscriminatorValues(ClassMetadata $classMetadata): array
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public function __construct(ListenersInvoker $listenersInvoker, EntityManagerInt
* Method schedules invoking of postLoad entity to the very end of current hydration cycle.
*
* @param object $entity
*
* @return void
*/
public function deferPostLoadInvoking(ClassMetadata $class, $entity)
{
Expand All @@ -70,6 +72,8 @@ public function deferPostLoadInvoking(ClassMetadata $class, $entity)
* This method should me called after any hydration cycle completed.
*
* Method fires all deferred invocations of postLoad events
*
* @return void
*/
public function hydrationComplete()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(ClassMetadataInfo $cm)
}

/**
* @return ClassMetadata
* @return ClassMetadataInfo
*/
public function getClassMetadata()
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Mapping/Builder/EntityListenerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class EntityListenerBuilder
* @param ClassMetadata $metadata The entity metadata.
* @param string $className The listener class name.
*
* @return void
*
* @throws MappingException When the listener class not found.
*/
public static function bindEntityListener(ClassMetadata $metadata, $className)
Expand Down

0 comments on commit b04d7a6

Please sign in to comment.