Skip to content

Commit 1ba51aa

Browse files
Merge branch 'main' into add-regex-operator
2 parents a477a68 + 133e0f5 commit 1ba51aa

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/Patterns/Path.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ public function named($variable): self
182182
*/
183183
public function withMinHops(int $minHops): self
184184
{
185-
if ($minHops < 1) {
186-
throw new DomainException("minHops cannot be less than 1");
185+
if ($minHops < 0) {
186+
throw new DomainException("minHops cannot be less than 0");
187187
}
188188

189189
if (isset($this->maxHops) && $minHops > $this->maxHops) {

tests/Unit/Patterns/RelationshipTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,6 @@ public function testMinHopsGreaterThanMaxHops()
378378
$r->withMinHops(100);
379379
}
380380

381-
public function testMinHopsLessThanOne()
382-
{
383-
$r = new Path($this->a, $this->b, Path::DIR_RIGHT);
384-
385-
$this->expectException(DomainException::class);
386-
387-
$r->withMinHops(0);
388-
}
389-
390381
public function testMinHopsLessThanZero()
391382
{
392383
$r = new Path($this->a, $this->b, Path::DIR_RIGHT);
@@ -558,4 +549,4 @@ public function provideWithMultipleTypesData(): array
558549
['a', ['a', 'b'], [], Path::DIR_LEFT, "(a)<-[a:a|b {}]-(b)"]
559550
];
560551
}
561-
}
552+
}

0 commit comments

Comments
 (0)