Issues (8)

src/Domain.php (3 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * Entity.
5
 */
6
7
namespace PiedWeb\UrlHarvester;
8
9
use Pdp\Cache;
0 ignored issues
show
The type Pdp\Cache was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Pdp\CurlHttpClient;
0 ignored issues
show
The type Pdp\CurlHttpClient was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Pdp\Manager;
0 ignored issues
show
The type Pdp\Manager was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Pdp\Rules;
13
14
class Domain
15
{
16
    protected static $rules;
17 12
18
    public static function resolve(string $host): \Pdp\ResolvedDomainName
19 12
    {
20
        return self::getRules()->resolve($host);
21
    }
22 12
23
    public static function getRegistrableDomain(string $host): ?string
24 12
    {
25
        return self::resolve($host)->registrableDomain()->toString();
26
    }
27 12
28
    protected static function getRules()
29 12
    {
30 12
        if (null !== self::$rules) {
31
            return self::$rules;
32
        }
33 3
34
        $reflector = new \ReflectionClass("Pdp\Rules");
35
        $base = \dirname($reflector->getFileName(), 2);
36
37
        return self::$rules = Rules::fromPath($base.'/test_data/public_suffix_list.dat');
38
39
        //return self::$rules = (new Manager(new Cache(), new CurlHttpClient()))->getRules();
40
    }
41
}
42