Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michnovka committed Dec 14, 2022
1 parent 00ffaa6 commit f74e586
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/en/reference/basic-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ Since version 2.14 you can specify custom typed field mapping between PHP type a
$configuration->addTypedFieldMapping(CustomIdObject::class, CustomIdType::class);
then, an entity using the ``CustomIdObject`` typed field will be correctly assigned its DBAL type
(``CustomIdObjectType``) without the need of explicit declaration
Then, an entity using the ``CustomIdObject`` typed field will be correctly assigned its DBAL type
(``CustomIdObjectType``) without the need of explicit declaration.

.. configuration-block::

Expand Down
13 changes: 4 additions & 9 deletions lib/Doctrine/ORM/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,8 @@ public function setCustomDatetimeFunctions(array $functions)
*
* @param array $mappings The map of custom DQL date/time functions.
* @psalm-param array<class-string, class-string<Type>|string> $mappings
*
* @return void
*/
public function setTypedFieldMappings(array $mappings)
public function setTypedFieldMappings(array $mappings): void
{
foreach ($mappings as $phpType => $dbalType) {
$this->addTypedFieldMapping($phpType, $dbalType);
Expand All @@ -772,10 +770,8 @@ public function setTypedFieldMappings(array $mappings)
/**
* @psalm-param class-string $phpType the FQCN of PHP type to be mapped
* @psalm-param class-string<Type>|string $dbalType either FQCN of DBAL Type or its name
*
* @return void
*/
public function addTypedFieldMapping(string $phpType, string $dbalType)
public function addTypedFieldMapping(string $phpType, string $dbalType): void
{
$this->_attributes['typedFieldMappings'][$phpType] = $dbalType;
}
Expand All @@ -785,10 +781,9 @@ public function addTypedFieldMapping(string $phpType, string $dbalType)
*
* @psalm-param class-string $phpType the FQCN of PHP type to be mapped
*
* @return string|null
* @psalm-return class-string<Type>|string|null either FQCN of DBAL Type or its name
*/
public function getTypedFieldMapping($phpType)
public function getTypedFieldMapping($phpType): ?string
{
return $this->_attributes['typedFieldMappings'][$phpType] ?? null;
}
Expand All @@ -798,7 +793,7 @@ public function getTypedFieldMapping($phpType)
*
* @psalm-return array<class-string,class-string<Type>|string>
*/
public function getTypedFieldMappings()
public function getTypedFieldMappings(): array
{
return $this->_attributes['typedFieldMappings'] ?? [];
}
Expand Down

0 comments on commit f74e586

Please sign in to comment.