Profile   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldCrawlCallback() 0 4 1
A shouldCrawl() 0 4 1
1
<?php
2
3
namespace Spatie\Sitemap\Crawler;
4
5
use Psr\Http\Message\UriInterface;
6
use Spatie\Crawler\CrawlProfile;
7
8
class Profile extends CrawlProfile
9
{
10
    /** @var callable */
11
    protected $profile;
12
13
    public function shouldCrawlCallback(callable $callback)
14
    {
15
        $this->profile = $callback;
16
    }
17
18
    /*
19
     * Determine if the given url should be crawled.
20
     */
21
    public function shouldCrawl(UriInterface $url): bool
22
    {
23
        return ($this->profile)($url);
24
    }
25
}
26