| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 58.81% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait Deprecation |
||
| 11 | { |
||
| 12 | protected static $next_version = '4.0'; |
||
| 13 | |||
| 14 | 20 | protected static function deprecatedClass(string $new_class): void |
|
| 15 | { |
||
| 16 | 20 | $old_class = static::getDeprecatedNamespace(); |
|
| 17 | |||
| 18 | 20 | static::deprecated( |
|
| 19 | 20 | 'The %s class has been deprecated and will be removed in version %s, use %s instead.', |
|
| 20 | $old_class, |
||
| 21 | 20 | static::$next_version, |
|
| 22 | $new_class |
||
| 23 | ); |
||
| 24 | 20 | } |
|
| 25 | |||
| 26 | protected static function deprecatedMethod(string $old_method, string $new_class, string $new_method = null): void |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | |||
| 40 | 20 | protected static function getDeprecatedNamespace(): string |
|
| 41 | { |
||
| 42 | 20 | return static::class; |
|
| 43 | } |
||
| 44 | |||
| 45 | 20 | protected static function deprecated(string $message, ...$args): void |
|
| 48 | 20 | } |
|
| 49 | } |
||
| 50 |