summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ContextGenerator.php6
-rw-r--r--tools/TestGenerator.php11
2 files changed, 10 insertions, 7 deletions
diff --git a/tools/ContextGenerator.php b/tools/ContextGenerator.php
index ac24156..7645564 100644
--- a/tools/ContextGenerator.php
+++ b/tools/ContextGenerator.php
@@ -3,6 +3,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tools;
+use Exception;
+
require_once __DIR__ . '/../vendor/autoload.php';
/**
@@ -391,9 +393,9 @@ if (count($argv) >= 3) {
// Checking if all directories are valid.
if (! is_dir($input)) {
- throw new \Exception('The input directory does not exist.');
+ throw new Exception('The input directory does not exist.');
} elseif (! is_dir($output)) {
- throw new \Exception('The output directory does not exist.');
+ throw new Exception('The output directory does not exist.');
}
// Finally, building the tests.
diff --git a/tools/TestGenerator.php b/tools/TestGenerator.php
index d52e708..abeeb3e 100644
--- a/tools/TestGenerator.php
+++ b/tools/TestGenerator.php
@@ -5,6 +5,7 @@ namespace PhpMyAdmin\SqlParser\Tools;
require_once '../vendor/autoload.php';
+use Exception;
use PhpMyAdmin\SqlParser\Lexer;
use PhpMyAdmin\SqlParser\Parser;
@@ -111,7 +112,7 @@ class TestGenerator
{
// Support query types: `lexer` / `parser`.
if (! in_array($type, ['lexer', 'parser'])) {
- throw new \Exception('Unknown test type (expected `lexer` or `parser`).');
+ throw new Exception('Unknown test type (expected `lexer` or `parser`).');
}
/**
@@ -123,7 +124,7 @@ class TestGenerator
// There is no point in generating a test without a query.
if (empty($query)) {
- throw new \Exception('No input query specified.');
+ throw new Exception('No input query specified.');
}
$test = static::generate($query, $type);
@@ -214,11 +215,11 @@ if (count($argv) >= 3) {
// Checking if all directories are valid.
if (! is_dir($input)) {
- throw new \Exception('The input directory does not exist.');
+ throw new Exception('The input directory does not exist.');
} elseif (! is_dir($output)) {
- throw new \Exception('The output directory does not exist.');
+ throw new Exception('The output directory does not exist.');
} elseif (($debug !== null) && (! is_dir($debug))) {
- throw new \Exception('The debug directory does not exist.');
+ throw new Exception('The debug directory does not exist.');
}
// Finally, building the tests.