Skip to content

Commit

Permalink
Avoid $annotation as a parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Nov 6, 2022
1 parent 218e6ad commit 8ea7827
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ private function loadRelationShipMapping(
/**
* Attempts to resolve the fetch mode.
*
* @param class-string $className
*
* @psalm-return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata.
*
* @throws MappingException If the fetch mode is not valid.
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,8 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
/**
* Attempts to resolve the fetch mode.
*
* @param string $className The class name.
* @param string $fetchMode The fetch mode.
* @param class-string $className The class name.
* @param string $fetchMode The fetch mode.
*
* @return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata.
*
Expand Down
15 changes: 5 additions & 10 deletions lib/Doctrine/ORM/Mapping/MappingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,20 +813,15 @@ public static function duplicateEntityListener($listenerName, $methodName, $clas
return new self(sprintf('Entity Listener "%s#%s()" in "%s" was already declared, but it must be declared only once.', $listenerName, $methodName, $className));
}

/**
* @param string $className
* @param string $annotation
*
* @return MappingException
*/
public static function invalidFetchMode($className, $annotation)
/** @param class-string $className */
public static function invalidFetchMode(string $className, string $fetchMode): self
{
return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $fetchMode . "'");
}

public static function invalidGeneratedMode(string $annotation): MappingException
public static function invalidGeneratedMode(string $generatedMode): self
{
return new self("Invalid generated mode '" . $annotation . "'");
return new self("Invalid generated mode '" . $generatedMode . "'");
}

/**
Expand Down

0 comments on commit 8ea7827

Please sign in to comment.