Completed
Push — master ( 0341a7...f4eb9e )
by Craig
05:29 queued 37s
created

ExtensionPreStateChangeEvent::getNewState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula Foundation - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\ExtensionsModule\Event;
15
16
use Zikula\ExtensionsModule\Entity\ExtensionEntity;
17
18
/**
19
 * Occurs before updating the state of an extension. The event itself cannot affect the workflow unless
20
 * an exception is thrown to completely halt. For example, performing a permissions check.
21
 */
22
class ExtensionPreStateChangeEvent extends ExtensionEntityEvent
23
{
24
    /**
25
     * The intended new state for the extension.
26
     * @var int
27
     */
28
    private $newState;
29
30
    public function __construct(ExtensionEntity $extensionEntity, int $newState)
31
    {
32
        parent::__construct($extensionEntity);
33
        $this->newState = $newState;
34
    }
35
36
    public function getNewState(): int
37
    {
38
        return $this->newState;
39
    }
40
}
41