]> Raphaël G. Git Repositories - packbundle/blobdiff - Parser/TokenParser.php
Fix error exception invalid parameters
[packbundle] / Parser / TokenParser.php
index 7749ad28070bdc3bc4dbeaae5ed3dc5b1ae5d509..de425a770c2b5f280526b43046d0972f926dade0 100644 (file)
@@ -1,4 +1,13 @@
-<?php
+<?php declare(strict_types=1);
+
+/*
+ * This file is part of the Rapsys PackBundle package.
+ *
+ * (c) Raphaël Gertz <symfony@rapsys.eu>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
 
 namespace Rapsys\PackBundle\Parser;
 
@@ -17,9 +26,36 @@ use Twig\Token;
 use Twig\TokenParser\AbstractTokenParser;
 
 class TokenParser extends AbstractTokenParser {
+       ///The locator
+       protected $locator;
+
+       ///The package
+       protected $package;
+
+       ///The name
+       protected $name;
+
+       ///The scheme
+       protected $scheme;
+
+       ///The timeout
+       protected $timeout;
+
+       ///The agent
+       protected $agent;
+
+       ///The redirect
+       protected $redirect;
+
        ///The tag name
        protected $tag;
 
+       ///The output
+       protected $output;
+
+       ///The filters
+       protected $filters;
+
        /**
         * Constructor
         *
@@ -316,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
@@ -369,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);
                        }
                }