Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
EmergencyTimeoutException
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\RequestTimeout;
5
6/**
7 * An exception which is thrown if a critical section is open for too long.
8 */
9class EmergencyTimeoutException extends TimeoutException {
10    /**
11     * @param string $name The name of the critical section
12     * @param float $limit The limit (in seconds) which has expired
13     */
14    public function __construct( $name, $limit ) {
15        parent::__construct( "The critical section \"$name\" timed out after {limit} seconds",
16            $limit );
17    }
18}