Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| WrongNumberArgumentsException | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Exception; |
| 4 | |
| 5 | /** |
| 6 | * Category: Template helper |
| 7 | */ |
| 8 | class WrongNumberArgumentsException extends FlowException { |
| 9 | /** |
| 10 | * @param array $args |
| 11 | * @param string $minExpected |
| 12 | * @param string|null $maxExpected |
| 13 | */ |
| 14 | public function __construct( array $args, $minExpected, $maxExpected = null ) { |
| 15 | $count = count( $args ); |
| 16 | if ( $maxExpected === null ) { |
| 17 | parent::__construct( "Expected $minExpected arguments but received $count" ); |
| 18 | } else { |
| 19 | parent::__construct( |
| 20 | "Expected between $minExpected and $maxExpected arguments but received $count" |
| 21 | ); |
| 22 | } |
| 23 | } |
| 24 | } |