Completed
Push — develop ( 488cb7...121593 )
by Jaap
16s
created

PreTransformationEvent::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author    Mike van Riel <[email protected]>
12
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
14
 * @link      http://phpdoc.org
15
 */
16
17
namespace phpDocumentor\Transformer\Event;
18
19
use phpDocumentor\Event\EventAbstract;
20
use phpDocumentor\Transformer\Transformation;
21
22
/**
23
 * Event happening prior to each individual transformation.
24
 */
25
class PreTransformationEvent extends EventAbstract
26
{
27
    /** @var Transformation */
28
    protected $transformation;
29
30
    public function __construct($subject, Transformation $transformation)
31
    {
32
        parent::__construct($subject);
33
        $this->transformation = $transformation;
34
    }
35
36 1
    public static function create($subject, Transformation $transformation)
37
    {
38 1
        return new static($subject, $transformation);
39
    }
40
41
    public function getTransformation(): Transformation
42
    {
43
        return $this->transformation;
44 1
    }
45
}
46