Completed
Push — ezp-30616 ( ab7e14...128c78 )
by
unknown
17:09
created

BeforeHideLocationEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace eZ\Publish\Core\Event\Location;
6
7
use eZ\Publish\API\Repository\Values\Content\Location;
8
use eZ\Publish\Core\Event\BeforeEvent;
9
10
final class BeforeHideLocationEvent extends BeforeEvent
11
{
12
	public const NAME = 'ezplatform.event.location.hide.before';
13
14
	/**
15
     * @var \eZ\Publish\API\Repository\Values\Content\Location
16
     */
17
	private $location;
18
19
	/**
20
     * @var \eZ\Publish\API\Repository\Values\Content\Location|null
21
     */
22
	private $hiddenLocation;
23
24
25
	public function __construct(Location $location)
26
	{
27
		$this->location = $location;
28
	}
29
30
31
	public function getLocation(): Location
32
	{
33
		return $this->location;
34
	}
35
36
37
	function getHiddenLocation(): ?Location
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
38
	{
39
		return $this->hiddenLocation;
40
	}
41
42
43
	function setHiddenLocation(?Location $hiddenLocation): void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
44
	{
45
		$this->hiddenLocation = $hiddenLocation;
46
	}
47
48
49
	function hasHiddenLocation(): bool
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
50
	{
51
		return $this->hiddenLocation instanceof Location;
52
	}
53
}
54