Skip to content
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
2 changes: 1 addition & 1 deletion lib/Doctrine/Persistence/ManagerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getManager(?string $name = null) : ObjectManager;
/**
* Gets an array of all registered object managers.
*
* @return ObjectManager[] An array of ObjectManager instances
* @return array<string, ObjectManager> An array of ObjectManager instances
*/
public function getManagers() : array;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class AbstractClassMetadataFactory implements ClassMetadataFactory
/** @var Cache|null */
private $cacheDriver;

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

/** @var bool */
Expand Down Expand Up @@ -73,7 +73,7 @@ public function getLoadedMetadata() : array
* Forces the factory to load the metadata of all classes known to the underlying
* mapping driver.
*
* @return ClassMetadata[] The ClassMetadata instances of all mapped classes.
* @return array<int, ClassMetadata> The ClassMetadata instances of all mapped classes.
*/
public function getAllMetadata() : array
{
Expand Down Expand Up @@ -222,7 +222,7 @@ public function setMetadataFor(string $className, ClassMetadata $class) : void
/**
* Gets an array of parent classes for the given entity class.
*
* @return string[]
* @return array<int, string>
*/
protected function getParentClasses(string $name) : array
{
Expand Down Expand Up @@ -255,7 +255,7 @@ protected function getParentClasses(string $name) : array
*
* @param string $name The name of the class for which the metadata should get loaded.
*
* @return string[]
* @return array<int, string>
*/
protected function loadMetadata(string $name) : array
{
Expand Down Expand Up @@ -323,8 +323,7 @@ protected function onNotFoundMetadata(string $className) : ?ClassMetadata
/**
* Actually loads the metadata from the underlying metadata.
*
* @param string[] $nonSuperclassParents All parent class names
* that are not marked as mapped superclasses.
* @param array<int, string> $nonSuperclassParents All parent class names that are not marked as mapped superclasses.
*/
abstract protected function doLoadMetadata(
ClassMetadata $class,
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Persistence/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getName() : string;
*
* The returned structure is an array of the identifier field names.
*
* @return mixed[]
* @return array<int, string>
*/
public function getIdentifier() : array;

Expand Down Expand Up @@ -108,7 +108,7 @@ public function getAssociationMappedByTargetField(string $associationName) : str
*
* Has to return an empty array if no identifier isset.
*
* @return mixed[]
* @return array<string, mixed>
*/
public function getIdentifierValues(object $object) : array;
}
2 changes: 1 addition & 1 deletion lib/Doctrine/Persistence/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ClassMetadataFactory
* Forces the factory to load the metadata of all classes known to the underlying
* mapping driver.
*
* @return ClassMetadata[] The ClassMetadata instances of all mapped classes.
* @return array<int, ClassMetadata> The ClassMetadata instances of all mapped classes.
*/
public function getAllMetadata() : array;

Expand Down
9 changes: 3 additions & 6 deletions lib/Doctrine/Persistence/Mapping/Driver/FileDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,16 @@ public function getAllClassNames() : array
return $this->locator->getAllClassNames($this->globalBasename);
}

/** @var ClassMetadata[] $classCache */
/** @var array<string, ClassMetadata> $classCache */
$classCache = $this->classCache;

/** @var string[] $keys */
/** @var array<int, string> $keys */
$keys = array_keys($classCache);

/** @var string[] $merged */
$merged = array_unique(array_merge(
return array_unique(array_merge(
$keys,
$this->locator->getAllClassNames($this->globalBasename)
));

return $merged;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MappingDriverChain implements MappingDriver
*/
private $defaultDriver;

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

/**
Expand Down Expand Up @@ -53,7 +53,7 @@ public function addDriver(MappingDriver $nestedDriver, string $namespace) : void
/**
* Gets the array of nested drivers.
*
* @return MappingDriver[] $drivers
* @return array<string, MappingDriver> $drivers
*/
public function getDrivers() : array
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Persistence/Mapping/MappingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class MappingException extends Exception
{
/**
* @param string[] $namespaces
* @param array<int, string> $namespaces
*/
public static function classNotFoundInNamespaces(
string $className,
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/Persistence/ObjectRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function find($id) : ?object;
/**
* Finds all objects in the repository.
*
* @return object[] The objects.
* @return array<int, object> The objects.
*/
public function findAll() : array;

Expand All @@ -34,10 +34,10 @@ public function findAll() : array;
* an UnexpectedValueException if certain values of the sorting or limiting details are
* not supported.
*
* @param mixed[] $criteria
* @param string[]|null $orderBy
* @param array<string, mixed> $criteria
* @param array<string, string> $orderBy
*
* @return object[] The objects.
* @return array<int, object> The objects.
*
* @throws UnexpectedValueException
*/
Expand All @@ -51,7 +51,7 @@ public function findBy(
/**
* Finds a single object by a set of criteria.
*
* @param mixed[] $criteria The criteria.
* @param array<string, mixed> $criteria The criteria.
*
* @return object|null The object.
*/
Expand Down