diff --git a/CHANGELOG.md b/CHANGELOG.md index b26339f..17e25f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ See [GitHub releases](https://github.com/mll-lab/php-utils/releases). ## Unreleased +## v5.5.1 + +### Fixed + +- Fix generic inference for `MLL\Utils\Microplate\Coordinates::fromPosition()` + ## v5.5.0 ### Added diff --git a/src/Microplate/Coordinates.php b/src/Microplate/Coordinates.php index ab6bdbe..c6f3ddd 100644 --- a/src/Microplate/Coordinates.php +++ b/src/Microplate/Coordinates.php @@ -92,9 +92,11 @@ public static function fromString(string $coordinatesString, CoordinateSystem $c } /** - * @param TCoordinateSystem $coordinateSystem + * @template TCoord of CoordinateSystem + * + * @param TCoord $coordinateSystem * - * @return static + * @return static */ public static function fromPosition(int $position, FlowDirection $direction, CoordinateSystem $coordinateSystem): self { diff --git a/src/Microplate/MicroplateSet/MicroplateSet.php b/src/Microplate/MicroplateSet/MicroplateSet.php index 61d1d6b..f00b249 100644 --- a/src/Microplate/MicroplateSet/MicroplateSet.php +++ b/src/Microplate/MicroplateSet/MicroplateSet.php @@ -42,7 +42,6 @@ public function locationFromPosition(int $setPosition, FlowDirection $direction) $plateIndex = (int) floor(($setPosition - 1) / $this->coordinateSystem->positionsCount()); $positionOnSinglePlate = $setPosition - ($plateIndex * $this->coordinateSystem->positionsCount()); - /** @phpstan-ignore-next-line Generic inference is too weak to recognize this code is correct */ return new Location( Coordinates::fromPosition($positionOnSinglePlate, $direction, $this->coordinateSystem), $this->plateIDs()[$plateIndex]