Passed
Push — main ( 9de461...110add )
by Andrey
01:31
created

Deprecation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 9
cts 9
cp 1
rs 10
wmc 3

3 Methods

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