Code Duplication    Length = 14-14 lines in 2 locations

src/Html/Has.php 1 location

@@ 8-21 (lines=14) @@
5
use Symfony\Component\DomCrawler\Crawler;
6
use Psr7Unitesting\Utils\ValueConstraintTrait;
7
8
class Has extends AbstractConstraint
9
{
10
    use ValueConstraintTrait;
11
12
    public function toString()
13
    {
14
        return sprintf('has at least one element matching with the selector "%s"', $this->expected);
15
    }
16
17
    protected function runMatches(Crawler $html)
18
    {
19
        return count($html->filter($this->expected)) > 0;
20
    }
21
}
22

src/Html/HasNot.php 1 location

@@ 8-21 (lines=14) @@
5
use Symfony\Component\DomCrawler\Crawler;
6
use Psr7Unitesting\Utils\ValueConstraintTrait;
7
8
class HasNot extends AbstractConstraint
9
{
10
    use ValueConstraintTrait;
11
12
    public function toString()
13
    {
14
        return sprintf('has not any element matching with the selector "%s"', $this->expected);
15
    }
16
17
    protected function runMatches(Crawler $html)
18
    {
19
        return count($html->filter($this->expected)) === 0;
20
    }
21
}
22