Skip to content

Commit e142060

Browse files
committed
Fix generic inference for MLL\Utils\Microplate\Coordinates::fromPosition()
1 parent afe3783 commit e142060

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ See [GitHub releases](https://github.com/mll-lab/php-utils/releases).
99

1010
## Unreleased
1111

12+
## v5.5.1
13+
14+
### Fixed
15+
16+
- Fix generic inference for `MLL\Utils\Microplate\Coordinates::fromPosition()`
17+
1218
## v5.5.0
1319

1420
### Added

src/Microplate/Coordinates.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ public static function fromString(string $coordinatesString, CoordinateSystem $c
9292
}
9393

9494
/**
95-
* @param TCoordinateSystem $coordinateSystem
95+
* @template TCoord of CoordinateSystem
96+
*
97+
* @param TCoord $coordinateSystem
9698
*
97-
* @return static<TCoordinateSystem>
99+
* @return static<TCoord>
98100
*/
99101
public static function fromPosition(int $position, FlowDirection $direction, CoordinateSystem $coordinateSystem): self
100102
{

src/Microplate/MicroplateSet/MicroplateSet.php

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public function locationFromPosition(int $setPosition, FlowDirection $direction)
4242
$plateIndex = (int) floor(($setPosition - 1) / $this->coordinateSystem->positionsCount());
4343
$positionOnSinglePlate = $setPosition - ($plateIndex * $this->coordinateSystem->positionsCount());
4444

45-
/** @phpstan-ignore-next-line Generic inference is too weak to recognize this code is correct */
4645
return new Location(
4746
Coordinates::fromPosition($positionOnSinglePlate, $direction, $this->coordinateSystem),
4847
$this->plateIDs()[$plateIndex]

0 commit comments

Comments
 (0)