1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | namespace EddIriarte\Console\Inputs\Exceptions; |
||
0 ignored issues
–
show
|
|||
3 | |||
4 | class IndexOutOfRange extends \Exception |
||
0 ignored issues
–
show
|
|||
5 | { |
||
0 ignored issues
–
show
|
|||
6 | 2 | public function __construct(string $index) |
|
0 ignored issues
–
show
|
|||
7 | { |
||
0 ignored issues
–
show
|
|||
8 | 2 | parent::__construct("Index \"$index\" does not exists."); |
|
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $index instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
![]() |
|||
9 | } |
||
0 ignored issues
–
show
|
|||
10 | } |
||
0 ignored issues
–
show
|