Passed
Push — main ( 1a8771...d7bb24 )
by Andrey
11:52 queued 10:31
created

Deprecation::getDeprecatedNamespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Helldar\Support\Concerns;
4
5
trait Deprecation
6
{
7
    protected static function deprecatedMethod(string $old_method, string $new_class, string $new_method): void
8
    {
9
        $namespace = static::getDeprecatedNamespace();
10
11
        static::deprecated(
12
            'The %s::%s() method has been deprecated and will be removed in version 4.0, use  %s::%s() instead.',
13
            $namespace,
14
            $old_method,
15
            $new_class,
16
            $new_method
17
        );
18
    }
19
20
    protected static function getDeprecatedNamespace(): string
21
    {
22
        return static::class;
23
    }
24
25
    protected static function deprecated(string $message, ...$args): void
26
    {
27
        trigger_deprecation('andrey-helldar/support', '4.0', $message, ...$args);
28
    }
29
}
30