Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| CannotReplaceActiveServiceException | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | /** |
| 5 | * Exception thrown when trying to replace an already active service. |
| 6 | * |
| 7 | * @license GPL-2.0-or-later |
| 8 | * @file |
| 9 | */ |
| 10 | |
| 11 | namespace Wikimedia\Services; |
| 12 | |
| 13 | use Exception; |
| 14 | use Psr\Container\ContainerExceptionInterface; |
| 15 | use RuntimeException; |
| 16 | |
| 17 | /** |
| 18 | * Exception thrown when trying to replace an already active service. |
| 19 | */ |
| 20 | class CannotReplaceActiveServiceException extends RuntimeException |
| 21 | implements ContainerExceptionInterface { |
| 22 | |
| 23 | /** |
| 24 | * @param string $serviceName |
| 25 | * @param Exception|null $previous |
| 26 | */ |
| 27 | public function __construct( string $serviceName, ?Exception $previous = null ) { |
| 28 | parent::__construct( "Cannot replace an active service: $serviceName", 0, $previous ); |
| 29 | } |
| 30 | |
| 31 | } |