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

BaseDeprecations   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isDeprecated() 0 4 1
A getDeprecationReason() 0 4 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