Completed
Push — master ( 7ba6fb...31ed5b )
by Dev
39:27 queued 38:12
created

Url::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1.0028

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 7
ccs 6
cts 7
cp 0.8571
crap 1.0028
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PiedWeb\SeoPocketCrawler;
4
5
use PiedWeb\UrlHarvester\Harvest;
6
7
class Url
8
{
9
    public $sha1;
10
    public $uri;
11
    public $updated_at;
12
    public $can_be_crawled;
13
    public $indexable;
14
    public $links;
15
    public $links_duplicate;
16
    public $links_self;
17
    public $links_internal;
18
    public $links_sub;
19
    public $links_external;
20
    public $ratio_text_code;
21
    public $load_time;
22
    public $size;
23
    public $title;
24
    public $kws;
25
    public $h1;
26
27 2
    public function __construct($url, $click)
28
    {
29 2
        $this->sha1 = sha1($url);
30 2
        $this->uri = substr($url, strlen(Harvest::getDomainAndSchemeFrom($url)));
31 2
        $this->updated_at = date('Ymd');
32 2
        $this->inboundlinks = 0;
0 ignored issues
show
Bug Best Practice introduced by
The property inboundlinks does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
33 2
        $this->click = $click;
0 ignored issues
show
Bug Best Practice introduced by
The property click does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
34 2
    }
35
}
36