Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit d7f0074

Browse files
authored
Add constants CoordinateSystem*Well::POSITIONS_COUNT and MicroplateSet*::PLATE_COUNT
1 parent a2588a8 commit d7f0074

10 files changed

+962
-557
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## Unreleased
1111

12+
## v6.3.0
13+
14+
### Added
15+
16+
- Add constants `CoordinateSystem*Well::POSITIONS_COUNT`
17+
- Add constants `MicroplateSet*::PLATE_COUNT`
18+
1219
## v6.2.0
1320

1421
### Added

composer.lock

Lines changed: 909 additions & 557 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CoordinateSystem12Well.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
final class CoordinateSystem12Well extends CoordinateSystem
66
{
7+
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
8+
public const POSITIONS_COUNT = 12;
9+
710
public function rows(): array
811
{
912
return range('A', 'C');

src/CoordinateSystem48Well.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
final class CoordinateSystem48Well extends CoordinateSystem
66
{
7+
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
8+
public const POSITIONS_COUNT = 48;
9+
710
public function rows(): array
811
{
912
return range('A', 'F');

src/CoordinateSystem96Well.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
final class CoordinateSystem96Well extends CoordinateSystem
66
{
7+
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
8+
public const POSITIONS_COUNT = 96;
9+
710
public function rows(): array
811
{
912
return range('A', 'H');

src/MicroplateSet/MicroplateSetAB.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
final class MicroplateSetAB extends MicroplateSet
1313
{
14+
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
15+
public const PLATE_COUNT = 2;
16+
1417
public function plateIDs(): array
1518
{
1619
return ['A', 'B'];

src/MicroplateSet/MicroplateSetABCD.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
final class MicroplateSetABCD extends MicroplateSet
1313
{
14+
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
15+
public const PLATE_COUNT = 4;
16+
1417
public function plateIDs(): array
1518
{
1619
return ['A', 'B', 'C', 'D'];

src/MicroplateSet/MicroplateSetABCDE.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
final class MicroplateSetABCDE extends MicroplateSet
1313
{
14+
/** Duplicates @see MicroplateSet::plateCount() for static contexts. */
15+
public const PLATE_COUNT = 5;
16+
1417
public function plateIDs(): array
1518
{
1619
return ['A', 'B', 'C', 'D', 'E'];

tests/Unit/CoordinateSystemTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ public static function firstLast(): iterable
2929
yield [new CoordinateSystem48Well(), 'A1', 'F8'];
3030
yield [new CoordinateSystem96Well(), 'A1', 'H12'];
3131
}
32+
33+
public function testPositionsCount(): void
34+
{
35+
self::assertSame(CoordinateSystem12Well::POSITIONS_COUNT, (new CoordinateSystem12Well())->positionsCount());
36+
self::assertSame(CoordinateSystem48Well::POSITIONS_COUNT, (new CoordinateSystem48Well())->positionsCount());
37+
self::assertSame(CoordinateSystem96Well::POSITIONS_COUNT, (new CoordinateSystem96Well())->positionsCount());
38+
}
3239
}

tests/Unit/MicroplateSetTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Mll\Microplate\Tests\Unit;
4+
5+
use Mll\Microplate\CoordinateSystem96Well;
6+
use Mll\Microplate\MicroplateSet\MicroplateSetAB;
7+
use Mll\Microplate\MicroplateSet\MicroplateSetABCD;
8+
use Mll\Microplate\MicroplateSet\MicroplateSetABCDE;
9+
use PHPUnit\Framework\TestCase;
10+
11+
final class MicroplateSetTest extends TestCase
12+
{
13+
public function testPlateCount(): void
14+
{
15+
$anyCoordinateSystemWillDo = new CoordinateSystem96Well();
16+
17+
self::assertSame(MicroplateSetAB::PLATE_COUNT, (new MicroplateSetAB($anyCoordinateSystemWillDo))->plateCount());
18+
self::assertSame(MicroplateSetABCD::PLATE_COUNT, (new MicroplateSetABCD($anyCoordinateSystemWillDo))->plateCount());
19+
self::assertSame(MicroplateSetABCDE::PLATE_COUNT, (new MicroplateSetABCDE($anyCoordinateSystemWillDo))->plateCount());
20+
}
21+
}

0 commit comments

Comments
 (0)