Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| NullMetric | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __call | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | declare( strict_types=1 ); |
| 8 | |
| 9 | namespace Wikimedia\Stats\Metrics; |
| 10 | |
| 11 | /** |
| 12 | * Null Metric Implementation |
| 13 | * |
| 14 | * When a request from cache yields a type other than what was requested |
| 15 | * or an unrecoverable situation has occurred, an instance of this class |
| 16 | * should be passed to the caller to provide an interface that suppresses |
| 17 | * method calls against it. |
| 18 | * |
| 19 | * @author Cole White |
| 20 | * @since 1.38 |
| 21 | */ |
| 22 | class NullMetric { |
| 23 | |
| 24 | /** |
| 25 | * Silently suppress all undefined method calls. |
| 26 | * |
| 27 | * @param $method_name string |
| 28 | * @param $args array |
| 29 | * @return NullMetric |
| 30 | */ |
| 31 | public function __call( string $method_name, array $args ): NullMetric { |
| 32 | return $this; |
| 33 | } |
| 34 | |
| 35 | } |