Skip to content

Commit 2090c81

Browse files
committed
Linter fix, tests fix
1 parent 99ce84d commit 2090c81

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Http/Validator/Domain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function isValid($value): bool
4949
return false;
5050
}
5151

52-
if(\str_ends_with($value, '.')) {
52+
if(\str_ends_with($value, '.') || \str_ends_with($value, '-')) {
5353
return false;
5454
}
5555

tests/Validator/DomainTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public function testIsValid()
1919
$this->assertEquals(true, $this->domain->isValid('example.com'));
2020
$this->assertEquals(true, $this->domain->isValid('subdomain.example.com'));
2121
$this->assertEquals(true, $this->domain->isValid('subdomain.example-app.com'));
22-
$this->assertEquals(true, $this->domain->isValid('subdomain.example_app.com'));
22+
$this->assertEquals(false, $this->domain->isValid('subdomain.example_app.com'));
2323
$this->assertEquals(true, $this->domain->isValid('subdomain-new.example.com'));
24-
$this->assertEquals(true, $this->domain->isValid('subdomain_new.example.com'));
24+
$this->assertEquals(false, $this->domain->isValid('subdomain_new.example.com'));
2525
$this->assertEquals(true, $this->domain->isValid('localhost'));
2626
$this->assertEquals(true, $this->domain->isValid('example.io'));
2727
$this->assertEquals(true, $this->domain->isValid('example.org'));

0 commit comments

Comments
 (0)