Completed
Pull Request — master (#1)
by Romain
02:17
created

Image   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
namespace Kerox\Messenger\Model\Message\Attachment;
3
4
use Kerox\Messenger\Model\Message\Attachment;
5
6
class Image extends File
7
{
8
9
    /**
10
     * @var array
11
     */
12
    protected $allowedExtension = ['jpg', 'png', 'gif'];
13
14
    /**
15
     * Image constructor.
16
     *
17
     * @param string $url
18
     * @param bool|null $reusable
19
     */
20
    public function __construct(string $url, bool $reusable = null)
21
    {
22
        $this->isValidExtension($url, $this->allowedExtension);
23
24
        parent::__construct($url, $reusable, Attachment::TYPE_IMAGE);
25
    }
26
}
27