]> Raphaël G. Git Repositories - packbundle/commitdiff
Fix error exception invalid parameters
authorRaphaël Gertz <git@rapsys.eu>
Mon, 31 Jul 2023 23:29:42 +0000 (01:29 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 31 Jul 2023 23:29:42 +0000 (01:29 +0200)
Parser/TokenParser.php

index b5543d2fab5849eedf68010d00ca0ce5c29aa904..de425a770c2b5f280526b43046d0972f926dade0 100644 (file)
@@ -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);
                        }
                }