Completed
Push — master ( 7663ef...05b01b )
by Freek
01:15
created

MixedContent::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Spatie\MixedContentScanner;
4
5
use Spatie\Crawler\Url;
6
7
class MixedContent
8
{
9
    /** string */
10
    public $elementName = '';
11
12
    /** @var\Spatie\Crawler\Url */
13
    public $mixedContentUrl = null;
14
15
    /** @var\Spatie\Crawler\Url */
16
    public $foundOnUrl = null;
17
18
    public function __construct(string $elementName, Url $mixedContentUrl, Url $foundOnUrl)
19
    {
20
        $this->elementName = $elementName;
21
22
        $this->mixedContentUrl = $mixedContentUrl;
23
24
        $this->foundOnUrl = $foundOnUrl;
25
    }
26
27
    public function toArray(): array
28
    {
29
        return [
30
            'elementName' => $this->elementName,
31
            'mixedContentUrl' => (string) $this->mixedContentUrl,
32
            'foundOnUrl' => (string) $this->foundOnUrl,
33
        ];
34
    }
35
}
36