1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Everlution\Navigation\Match\Voter; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
6 | |||
7 | /** |
||
8 | * Class InvalidRegexPatternException. |
||
9 | * |
||
10 | * @author Ivan Barlog <[email protected]> |
||
11 | */ |
||
12 | class InvalidRegexPatternException extends \InvalidArgumentException |
||
13 | { |
||
14 | public function __construct(string $pattern) |
||
15 | { |
||
16 | parent::__construct( |
||
17 | "Pattern '$pattern' is not valid regex pattern. Correct pattern would be '/regex expression/modifiers'" |
||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $pattern 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);
![]() |
|||
18 | ); |
||
19 | } |
||
20 | } |
||
21 |