EmptyImage   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A getWidth() 0 3 1
A getHeight() 0 3 1
A setType() 0 3 1
A getHash() 0 3 1
A setHash() 0 3 1
1
<?php
2
3
namespace Rostenkowski\Resize\Entity;
4
5
6
use Nette\Utils\Image;
7
use Rostenkowski\Resize\Meta;
8
9
/**
10
 * "Image not found" entity
11
 */
12
class EmptyImage implements Meta
13
{
14
15
	public function getHash()
16
	{
17
		return '_empty';
18
	}
19
20
21
	public function getType()
22
	{
23
		return Image::PNG;
24
	}
25
26
27
	public function setHash($hash)
28
	{
29
		throw new \LogicException('Unavailable image hash cannot be changed.');
30
	}
31
32
33
	public function setType($type)
34
	{
35
		throw new \LogicException('Unavailable image hash cannot be changed.');
36
	}
37
38
39
	public function getHeight()
40
	{
41
		return 1080;
42
	}
43
44
45
	public function getWidth()
46
	{
47
		return 1920;
48
	}
49
50
}
51