Image   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toArray() 0 6 1
1
<?php
2
3
namespace NotificationChannels\WhatsApp\Component;
4
5
class Image extends Component
6
{
7
    /**
8
     * Link to the image; e.g. https://URL.
9
     */
10
    protected string $link;
11
12 3
    public function __construct(string $link)
13
    {
14 3
        $this->link = $link;
15
    }
16
17 2
    public function toArray(): array
18
    {
19 2
        return [
20 2
            'type' => 'image',
21 2
            'image' => [
22 2
                'link' => $this->link,
23 2
            ],
24 2
        ];
25
    }
26
}
27