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