RegisterTransformersEvent   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A eventName() 0 4 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/flux/license
6
 * @link       https://www.flipboxfactory.com/software/flux/
7
 */
8
9
namespace flipbox\flux\events;
10
11
use flipbox\flux\Flux;
12
use yii\base\Event;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 */
18
class RegisterTransformersEvent extends Event
19
{
20
    /**
21
     * @event Event an event that is triggered when the transformers are registered.
22
     */
23
    const REGISTER_TRANSFORMERS = 'registerTransformer';
24
25
    /**
26
     * @param string $scope
27
     * @return string
28
     */
29
    public static function eventName(string $scope = Flux::GLOBAL_SCOPE)
30
    {
31
        return self::REGISTER_TRANSFORMERS . ':' . $scope;
32
    }
33
34
    /**
35
     * The transformer which will be used to alter data.  Keep in mind that multiple listeners may be registered on this
36
     * event and therefore can alter this value before/after.
37
     *
38
     * The returning array should be formatted as ['identifier' => transformer']
39
     *
40
     *
41
     * @var array
42
     */
43
    public $transformers = [];
44
}
45