diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 189105d..2f3eecb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,5 +12,3 @@ jobs: uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main cs: uses: innmind/github-workflows/.github/workflows/cs.yml@main - with: - php-version: '8.2' diff --git a/CHANGELOG.md b/CHANGELOG.md index fc587c4..68b8a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [Unreleased] + +### Changed + +- Requires PHP `8.4` +- Requires `innmind/foundation:~2.1` + ## 3.3.0 - 2025-07-30 ### Changed diff --git a/composer.json b/composer.json index 460e4cd..f2e02bf 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ "issues": "http://github.com/Innmind/ObjectGraph/issues" }, "require": { - "php": "~8.1", - "innmind/foundation": "~1.3", - "innmind/graphviz": "~4.0" + "php": "~8.4", + "innmind/foundation": "~2.1", + "innmind/graphviz": "~5.0" }, "autoload": { "psr-4": { @@ -31,8 +31,8 @@ } }, "require-dev": { - "innmind/black-box": "^6.4.1", - "innmind/static-analysis": "^1.2.1", + "innmind/black-box": "~6.5", + "innmind/static-analysis": "~1.3", "innmind/coding-standard": "~2.0" } } diff --git a/tests/GraphTest.php b/tests/GraphTest.php index 3c5fb61..dd3cf2f 100644 --- a/tests/GraphTest.php +++ b/tests/GraphTest.php @@ -79,7 +79,7 @@ public function testRemoveDependenciesSubGraph() $graph = $graph->removeDependenciesSubGraph(); - $this->assertCount(5, $graph->nodes()); + $this->assertSame(5, $graph->nodes()->size()); $this->assertNull( $graph ->nodes() @@ -152,7 +152,7 @@ public function testRemoveDependenciesSubGraph() $graph = $graph->removeDependenciesSubGraph(); - $this->assertCount(4, $graph->nodes()); + $this->assertSame(4, $graph->nodes()->size()); $this->assertNull( $graph ->nodes() @@ -246,8 +246,8 @@ public function testRemoveRootSubGraph() $graph = $graph->removeDependenciesSubGraph(); - $this->assertCount(1, $graph->nodes()); + $this->assertSame(1, $graph->nodes()->size()); $this->assertTrue($graph->nodes()->contains($graph->root())); - $this->assertCount(0, $graph->root()->relations()); + $this->assertSame(0, $graph->root()->relations()->size()); } } diff --git a/tests/LookupTest.php b/tests/LookupTest.php index 26e7f3e..d61cbbb 100644 --- a/tests/LookupTest.php +++ b/tests/LookupTest.php @@ -22,7 +22,7 @@ public function testInvokation() $nodes = Lookup::of()($root)->nodes(); - $this->assertCount(4, $nodes); + $this->assertSame(4, $nodes->size()); $fromLeaf = $nodes ->find(static fn($node) => $node->comesFrom($leaf)) ->match( @@ -38,7 +38,7 @@ public function testInvokation() static fn() => null, ); $this->assertNotNull($fromA); - $this->assertCount(1, $fromA->relations()); + $this->assertSame(1, $fromA->relations()->size()); $this->assertTrue( $fromA ->relations() @@ -55,7 +55,7 @@ public function testInvokation() static fn() => null, ); $this->assertNotNull($fromB); - $this->assertCount(1, $fromB->relations()); + $this->assertSame(1, $fromB->relations()->size()); $this->assertTrue( $fromB ->relations() @@ -72,7 +72,7 @@ public function testInvokation() static fn() => null, ); $this->assertNotNull($fromRoot); - $this->assertCount(2, $fromRoot->relations()); + $this->assertSame(2, $fromRoot->relations()->size()); $this->assertTrue( $fromRoot ->relations() @@ -108,7 +108,7 @@ public function testCyclicGraph() $nodes = Lookup::of()($a)->nodes(); - $this->assertCount(2, $nodes); + $this->assertSame(2, $nodes->size()); $fromA = $nodes ->find(static fn($node) => $node->comesFrom($a)) ->match( @@ -116,7 +116,7 @@ public function testCyclicGraph() static fn() => null, ); $this->assertNotNull($fromA); - $this->assertCount(1, $fromA->relations()); + $this->assertSame(1, $fromA->relations()->size()); $this->assertTrue( $fromA ->relations() @@ -133,7 +133,7 @@ public function testCyclicGraph() static fn() => null, ); $this->assertNotNull($fromB); - $this->assertCount(1, $fromB->relations()); + $this->assertSame(1, $fromB->relations()->size()); $this->assertTrue( $fromB ->relations() @@ -162,7 +162,7 @@ public function __construct() $graph = Lookup::of()($root); // root + list prop as an ArrayObject + the 2 stdClass - $this->assertCount(4, $graph->nodes()); + $this->assertSame(4, $graph->nodes()->size()); } public function testTraverseSplObjectStorage() @@ -174,6 +174,6 @@ public function testTraverseSplObjectStorage() $graph = Lookup::of()($spl); // SplObjectStorage + 2 keys + 1 value - $this->assertCount(4, $graph->nodes()); + $this->assertSame(4, $graph->nodes()->size()); } } diff --git a/tests/NodeTest.php b/tests/NodeTest.php index f7223d3..9759445 100644 --- a/tests/NodeTest.php +++ b/tests/NodeTest.php @@ -26,7 +26,7 @@ public function testInterface() ); $this->assertInstanceOf(Set::class, $node->relations()); - $this->assertCount(1, $node->relations()); + $this->assertSame(1, $node->relations()->size()); $this->assertSame([$relation], $node->relations()->toList()); $this->assertTrue($node->comesFrom($object)); $this->assertFalse($node->comesFrom(new class {