Test Failed
Pull Request — master (#31)
by Keoghan
03:21
created

Image   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 3 1
A __construct() 0 4 1
A __set() 0 3 1
1
<?php
2
3
namespace App\Support\Images;
4
5
/**
6
 * @property-read string $name
7
 * @property-read string|null $localPath
8
 */
9
class Image
10
{
11
    /** @var string */
12
    protected $name;
13 2
14
    /** @var string|null */
15 2
    protected $localPath;
16 2
17 2
    public function __construct($name, $localPath = null)
18
    {
19 2
        $this->name = $name;
0 ignored issues
show
Bug introduced by
The property name is declared read-only in App\Support\Images\Image.
Loading history...
20
        $this->localPath = $localPath;
0 ignored issues
show
Bug introduced by
The property localPath is declared read-only in App\Support\Images\Image.
Loading history...
21 2
    }
22
23
    public function __get($name)
24
    {
25
        return $this->{$name} ?? null;
26
    }
27
28
    public function __set($name, $value)
29
    {
30
        throw new \RuntimeException("Cannot set the value of {$name}");
31
    }
32
}
33