Completed
Push — master ( f03f33...6249fb )
by Nils
11:31
created

LongUrlFilter::isResponseFiltered()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace whm\Smoke\Extensions\SmokeResponseRetriever\Retriever\Crawler\Filter;
4
5
use phm\HttpWebdriverClient\Http\Response\EffectiveUriAwareResponse;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\UriInterface;
8
use whm\Crawler\Filter;
9
use whm\Html\Uri;
10
11
class LongUrlFilter implements Filter
12
{
13
    /**
14
     * Filter urls that are too long. Mostly that is a sign of infinite loops
15
     *
16
     * @param UriInterface $currentUri
17
     * @param UriInterface $startUri
18
     * @return bool
19
     */
20
    public function isFiltered(UriInterface $currentUri, UriInterface $startUri)
21
    {
22
        return strlen((string)$currentUri) > 255;
23
    }
24
25
    public function isResponseFiltered(ResponseInterface $response, UriInterface $startUri)
26
    {
27
        return false;
28
    }
29
}
30