summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Component.php10
-rw-r--r--src/Core.php8
-rw-r--r--src/Exceptions/LexerException.php4
-rw-r--r--src/Exceptions/LoaderException.php4
-rw-r--r--src/Exceptions/ParserException.php3
-rw-r--r--src/Statements/InsertStatement.php2
-rw-r--r--src/Statements/PurgeStatement.php1
-rw-r--r--src/TokensList.php4
-rw-r--r--src/Translator.php6
-rw-r--r--src/UtfString.php13
10 files changed, 35 insertions, 20 deletions
diff --git a/src/Component.php b/src/Component.php
index 520735b..c461c78 100644
--- a/src/Component.php
+++ b/src/Component.php
@@ -11,6 +11,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser;
+use Exception;
+
/**
* A component (of a statement) is a part of a statement that is common to
* multiple query types.
@@ -29,7 +31,7 @@ abstract class Component
* @param TokensList $list the list of tokens that are being parsed
* @param array $options parameters for parsing
*
- * @throws \Exception not implemented yet
+ * @throws Exception not implemented yet
*
* @return mixed
*/
@@ -40,7 +42,7 @@ abstract class Component
) {
// This method should be abstract, but it can't be both static and
// abstract.
- throw new \Exception(Translator::gettext('Not implemented yet.'));
+ throw new Exception(Translator::gettext('Not implemented yet.'));
}
/**
@@ -52,7 +54,7 @@ abstract class Component
* @param mixed $component the component to be built
* @param array $options parameters for building
*
- * @throws \Exception not implemented yet
+ * @throws Exception not implemented yet
*
* @return string
*/
@@ -60,7 +62,7 @@ abstract class Component
{
// This method should be abstract, but it can't be both static and
// abstract.
- throw new \Exception(Translator::gettext('Not implemented yet.'));
+ throw new Exception(Translator::gettext('Not implemented yet.'));
}
/**
diff --git a/src/Core.php b/src/Core.php
index 1965a2f..8783ea8 100644
--- a/src/Core.php
+++ b/src/Core.php
@@ -6,6 +6,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser;
+use Exception;
+
class Core
{
/**
@@ -24,7 +26,7 @@ class Core
* error might be false positive or a partial result (even a bad one)
* might be needed.
*
- * @var \Exception[]
+ * @var Exception[]
*
* @see Core::error()
*/
@@ -33,9 +35,9 @@ class Core
/**
* Creates a new error log.
*
- * @param \Exception $error the error exception
+ * @param Exception $error the error exception
*
- * @throws \Exception throws the exception, if strict mode is enabled
+ * @throws Exception throws the exception, if strict mode is enabled
*/
public function error($error)
{
diff --git a/src/Exceptions/LexerException.php b/src/Exceptions/LexerException.php
index 7dd85a4..857d09b 100644
--- a/src/Exceptions/LexerException.php
+++ b/src/Exceptions/LexerException.php
@@ -6,6 +6,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Exceptions;
+use Exception;
+
/**
* Exception thrown by the lexer.
*
@@ -13,7 +15,7 @@ namespace PhpMyAdmin\SqlParser\Exceptions;
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
-class LexerException extends \Exception
+class LexerException extends Exception
{
/**
* The character that produced this error.
diff --git a/src/Exceptions/LoaderException.php b/src/Exceptions/LoaderException.php
index d809876..41d04ff 100644
--- a/src/Exceptions/LoaderException.php
+++ b/src/Exceptions/LoaderException.php
@@ -6,6 +6,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Exceptions;
+use Exception;
+
/**
* Exception thrown by the lexer.
*
@@ -13,7 +15,7 @@ namespace PhpMyAdmin\SqlParser\Exceptions;
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
-class LoaderException extends \Exception
+class LoaderException extends Exception
{
/**
* The failed load name.
diff --git a/src/Exceptions/ParserException.php b/src/Exceptions/ParserException.php
index 575eeb1..4cf6977 100644
--- a/src/Exceptions/ParserException.php
+++ b/src/Exceptions/ParserException.php
@@ -6,6 +6,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Exceptions;
+use Exception;
use PhpMyAdmin\SqlParser\Token;
/**
@@ -15,7 +16,7 @@ use PhpMyAdmin\SqlParser\Token;
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
-class ParserException extends \Exception
+class ParserException extends Exception
{
/**
* The token that produced this error.
diff --git a/src/Statements/InsertStatement.php b/src/Statements/InsertStatement.php
index 265929d..383b025 100644
--- a/src/Statements/InsertStatement.php
+++ b/src/Statements/InsertStatement.php
@@ -6,8 +6,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Statements;
-use PhpMyAdmin\SqlParser\Components\ArrayObj;
use PhpMyAdmin\SqlParser\Components\Array2d;
+use PhpMyAdmin\SqlParser\Components\ArrayObj;
use PhpMyAdmin\SqlParser\Components\IntoKeyword;
use PhpMyAdmin\SqlParser\Components\OptionsArray;
use PhpMyAdmin\SqlParser\Components\SetOperation;
diff --git a/src/Statements/PurgeStatement.php b/src/Statements/PurgeStatement.php
index eee6f4a..10d726e 100644
--- a/src/Statements/PurgeStatement.php
+++ b/src/Statements/PurgeStatement.php
@@ -7,7 +7,6 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Statements;
use PhpMyAdmin\SqlParser\Components\Expression;
-use PhpMyAdmin\SqlParser\Components\OptionsArray;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Statement;
use PhpMyAdmin\SqlParser\Token;
diff --git a/src/TokensList.php b/src/TokensList.php
index 507d68b..d56fb98 100644
--- a/src/TokensList.php
+++ b/src/TokensList.php
@@ -6,6 +6,8 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser;
+use ArrayAccess;
+
/**
* A structure representing a list of tokens.
*
@@ -13,7 +15,7 @@ namespace PhpMyAdmin\SqlParser;
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
-class TokensList implements \ArrayAccess
+class TokensList implements ArrayAccess
{
/**
* The array of tokens.
diff --git a/src/Translator.php b/src/Translator.php
index a169632..2c28370 100644
--- a/src/Translator.php
+++ b/src/Translator.php
@@ -6,12 +6,14 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser;
+use PhpMyAdmin\MoTranslator\Loader;
+
class Translator
{
/**
* The MoTranslator loader object.
*
- * @var \PhpMyAdmin\MoTranslator\Loader
+ * @var Loader
*/
private static $loader;
@@ -29,7 +31,7 @@ class Translator
{
if (is_null(self::$loader)) {
// Create loader object
- self::$loader = new \PhpMyAdmin\MoTranslator\Loader();
+ self::$loader = new Loader();
// Set locale
self::$loader->setlocale(
diff --git a/src/UtfString.php b/src/UtfString.php
index 9e6e55b..1a88a6b 100644
--- a/src/UtfString.php
+++ b/src/UtfString.php
@@ -13,6 +13,9 @@ declare(strict_types=1);
namespace PhpMyAdmin\SqlParser;
+use ArrayAccess;
+use Exception;
+
/**
* Implements array-like access for UTF-8 strings.
*
@@ -22,7 +25,7 @@ namespace PhpMyAdmin\SqlParser;
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
-class UtfString implements \ArrayAccess
+class UtfString implements ArrayAccess
{
/**
* The raw, multi-byte string.
@@ -141,11 +144,11 @@ class UtfString implements \ArrayAccess
* @param int $offset the offset to be set
* @param string $value the value to be set
*
- * @throws \Exception not implemented
+ * @throws Exception not implemented
*/
public function offsetSet($offset, $value)
{
- throw new \Exception('Not implemented.');
+ throw new Exception('Not implemented.');
}
/**
@@ -153,11 +156,11 @@ class UtfString implements \ArrayAccess
*
* @param int $offset the value to be unset
*
- * @throws \Exception not implemented
+ * @throws Exception not implemented
*/
public function offsetUnset($offset)
{
- throw new \Exception('Not implemented.');
+ throw new Exception('Not implemented.');
}
/**