Completed
Push — master ( 5ac91e...39483e )
by Kirill
38:30
created

BaseDeprecations::getDeprecationReason()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Base\Behavior;
11
12
use Railt\SDL\Contracts\Behavior\Deprecatable;
13
14
/**
15
 * Trait BaseDeprecations
16
 * @mixin Deprecatable
17
 */
18
trait BaseDeprecations
19
{
20
    /**
21
     * @var string|null
22
     */
23
    protected $deprecationReason;
24
25
    /**
26
     * @return bool
27
     */
28 78
    public function isDeprecated(): bool
29
    {
30 78
        return $this->deprecationReason !== null;
31
    }
32
33
    /**
34
     * @return string
35
     */
36 84
    public function getDeprecationReason(): string
37
    {
38 84
        return (string)$this->deprecationReason;
39
    }
40
}
41