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

getUpdatedLanguage()   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 0
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\Language;
6
7
use eZ\Publish\API\Repository\Values\Content\Language;
8
use eZ\Publish\Core\Event\BeforeEvent;
9
10
final class BeforeUpdateLanguageNameEvent extends BeforeEvent
11
{
12
	public const NAME = 'ezplatform.event.language.name_update.before';
13
14
	/**
15
     * @var \eZ\Publish\API\Repository\Values\Content\Language
16
     */
17
	private $language;
18
19
	/**
20
     * @var string
21
     */
22
	private $newName;
23
24
	/**
25
     * @var \eZ\Publish\API\Repository\Values\Content\Language|null
26
     */
27
	private $updatedLanguage;
28
29
30
	public function __construct(Language $language, string $newName)
31
	{
32
		$this->language = $language;
33
		$this->newName = $newName;
34
	}
35
36
37
	public function getLanguage(): Language
38
	{
39
		return $this->language;
40
	}
41
42
43
	public function getNewName(): string
44
	{
45
		return $this->newName;
46
	}
47
48
49
	function getUpdatedLanguage(): ?Language
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->updatedLanguage;
52
	}
53
54
55
	function setUpdatedLanguage(?Language $updatedLanguage): 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...
56
	{
57
		$this->updatedLanguage = $updatedLanguage;
58
	}
59
60
61
	function hasUpdatedLanguage(): 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...
62
	{
63
		return $this->updatedLanguage instanceof Language;
64
	}
65
}
66