From: Raphaƫl Gertz Date: Mon, 31 Jul 2023 23:29:42 +0000 (+0200) Subject: Fix error exception invalid parameters X-Git-Tag: 0.2.5~1 X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/9cdadd5cc41b1dd89a4cf45fd144594b8855b02d?ds=sidebyside;hp=64b64c20e1bab3722d13e9c5e36e1129aa4ad390 Fix error exception invalid parameters --- diff --git a/Parser/TokenParser.php b/Parser/TokenParser.php index b5543d2..de425a7 100644 --- a/Parser/TokenParser.php +++ b/Parser/TokenParser.php @@ -352,7 +352,7 @@ class TokenParser extends AbstractTokenParser { //Check that we have a / separator between bundle name and path if (($pos = strpos($file, '/')) === false) { - throw new Error(sprintf('Invalid path "%s"', $file), $token->getLine(), $stream->getSourceContext()); + throw new Error(sprintf('Invalid path "%s"', $file), $lineno, $source); } //Set bundle @@ -405,7 +405,7 @@ class TokenParser extends AbstractTokenParser { //Catch bundle does not exist or is not enabled exception again } catch(\InvalidArgumentException $e) { //Bail out as bundle or path is invalid and we have no way to know what was meant - throw new Error(sprintf('Invalid bundle name "%s" in path "%s". Maybe you meant "%s"', substr($file, 1, $pos - 1), $file, $bundle.'/'.$path), $token->getLine(), $stream->getSourceContext(), $e); + throw new Error(sprintf('Invalid bundle name "%s" in path "%s". Maybe you meant "%s"', substr($file, 1, $pos - 1), $file, $bundle.'/'.$path), $lineno, $source, $e); } }