Passed
Push — master ( 823aee...b9b37f )
by Alec
13:15 queued 12s
created

Deprecation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A method() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
// 11.03.23
5
6
namespace AlecRabbit\Spinner\Helper;
7
8
use AlecRabbit\Spinner\Mixin\NoInstanceTrait;
9
10
use function trigger_error;
11
12
use const E_USER_DEPRECATED;
13
14
final class Deprecation
15
{
16
    use NoInstanceTrait;
17
18
    public static function method(string $method, ?string $message = null): void
19
    {
20
        trigger_error(
21
            sprintf(
22
                'Method "%s" is deprecated%s.',
23
                $method,
24
                $message ?? sprintf(', %s', (string)$message),
25
            ),
26
            E_USER_DEPRECATED
27
        );
28
    }
29
}
30