diff options
author | Michal Čihař <michal@cihar.com> | 2017-10-10 13:44:04 +0200 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-10-10 13:44:04 +0200 |
commit | d5592264c2422cd4694d6d23f25faa5469cd1a0d (patch) | |
tree | 9fc92dddd7721edd100092659036b53af7215a2e /src | |
parent | 1ef63fad959b185a9d22e818360a4e16dc4c42a5 (diff) | |
download | sql-parser-d5592264c2422cd4694d6d23f25faa5469cd1a0d.zip sql-parser-d5592264c2422cd4694d6d23f25faa5469cd1a0d.tar.gz sql-parser-d5592264c2422cd4694d6d23f25faa5469cd1a0d.tar.bz2 |
Apply php-cs-fixer
Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Components/GroupKeyword.php | 1 | ||||
-rw-r--r-- | src/Components/IntoKeyword.php | 12 | ||||
-rw-r--r-- | src/Components/JoinKeyword.php | 8 | ||||
-rw-r--r-- | src/Components/ParameterDefinition.php | 6 | ||||
-rw-r--r-- | src/Components/RenameOperation.php | 4 | ||||
-rw-r--r-- | src/Components/SetOperation.php | 2 | ||||
-rw-r--r-- | src/Context.php | 4 | ||||
-rw-r--r-- | src/Exceptions/LoaderException.php | 1 | ||||
-rw-r--r-- | src/Lexer.php | 4 | ||||
-rw-r--r-- | src/UtfString.php | 4 | ||||
-rw-r--r-- | src/Utils/Formatter.php | 2 |
11 files changed, 25 insertions, 23 deletions
diff --git a/src/Components/GroupKeyword.php b/src/Components/GroupKeyword.php index 1c7dfdd..314201b 100644 --- a/src/Components/GroupKeyword.php +++ b/src/Components/GroupKeyword.php @@ -127,6 +127,5 @@ class GroupKeyword extends Component } return trim($component->expr); - } } diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php index 87d0e7a..17615f6 100644 --- a/src/Components/IntoKeyword.php +++ b/src/Components/IntoKeyword.php @@ -98,12 +98,12 @@ class IntoKeyword extends Component /** * Constructor. * - * @param string $type Type of destination (may be OUTFILE). - * @param string|Expression $dest Actual destination. - * @param array $columns Column list of destination. - * @param array $values Selected fields. - * @param OptionsArray $fields_options Options for FIELDS/COLUMNS keyword. - * @param OptionsArray $fields_keyword Options for OPTINOS keyword. + * @param string $type type of destination (may be OUTFILE) + * @param string|Expression $dest actual destination + * @param array $columns column list of destination + * @param array $values selected fields + * @param OptionsArray $fields_options options for FIELDS/COLUMNS keyword + * @param OptionsArray $fields_keyword options for OPTINOS keyword */ public function __construct( $type = null, diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index cf6d4aa..55b69ae 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -76,10 +76,10 @@ class JoinKeyword extends Component /** * Constructor. * - * @param string $type Join type - * @param Expression $expr Join expression. - * @param Condition[] $on Join conditions. - * @param ArrayObj $using Columns joined. + * @param string $type Join type + * @param Expression $expr join expression + * @param Condition[] $on join conditions + * @param ArrayObj $using columns joined * * @see JoinKeyword::$JOINS */ diff --git a/src/Components/ParameterDefinition.php b/src/Components/ParameterDefinition.php index a313a22..82a3567 100644 --- a/src/Components/ParameterDefinition.php +++ b/src/Components/ParameterDefinition.php @@ -45,9 +45,9 @@ class ParameterDefinition extends Component /** * Constructor. * - * @param string $name Parameter's name. - * @param string $inOut Parameter's directional type (IN / OUT or None). - * @param DataType $type Parameter's type. + * @param string $name parameter's name + * @param string $inOut parameter's directional type (IN / OUT or None) + * @param DataType $type parameter's type */ public function __construct($name = null, $inOut = null, $type = null) { diff --git a/src/Components/RenameOperation.php b/src/Components/RenameOperation.php index d48ddc4..2e3d6ef 100644 --- a/src/Components/RenameOperation.php +++ b/src/Components/RenameOperation.php @@ -37,8 +37,8 @@ class RenameOperation extends Component /** * Constructor. * - * @param Expression $old Old expression. - * @param Expression $new New expression containing new name. + * @param Expression $old old expression + * @param Expression $new new expression containing new name */ public function __construct($old = null, $new = null) { diff --git a/src/Components/SetOperation.php b/src/Components/SetOperation.php index 9439d88..83f2e55 100644 --- a/src/Components/SetOperation.php +++ b/src/Components/SetOperation.php @@ -38,7 +38,7 @@ class SetOperation extends Component * Constructor. * * @param string $column Field's name.. - * @param string $value New value. + * @param string $value new value */ public function __construct($column = null, $value = null) { diff --git a/src/Context.php b/src/Context.php index 928f0a1..3716e3a 100644 --- a/src/Context.php +++ b/src/Context.php @@ -10,7 +10,6 @@ namespace PhpMyAdmin\SqlParser; use PhpMyAdmin\SqlParser\Exceptions\LoaderException; -use PhpMyAdmin\SqlParser\Token; /** * Holds the configuration of the context that is currently used. @@ -309,10 +308,11 @@ abstract class Context * Checks if the given string is the beginning of a whitespace. * * @param string $str string to be checked + * @param mixed $end * * @return int the appropriate flag for the comment type */ - public static function isComment($str, $end=false) + public static function isComment($str, $end = false) { $len = strlen($str); if ($len == 0) { diff --git a/src/Exceptions/LoaderException.php b/src/Exceptions/LoaderException.php index 4276e80..e3cb283 100644 --- a/src/Exceptions/LoaderException.php +++ b/src/Exceptions/LoaderException.php @@ -29,6 +29,7 @@ class LoaderException extends \Exception * @param string $ch the character that produced this exception * @param int $pos the position of the character * @param int $code the code of this error + * @param mixed $name */ public function __construct($msg = '', $name = '', $code = 0) { diff --git a/src/Lexer.php b/src/Lexer.php index e734c6f..f5972d8 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -567,7 +567,7 @@ class Lexer extends Core while ( ++$this->last < $this->len - && '0' <= $this->str[$this->last] + && $this->str[$this->last] >= '0' && $this->str[$this->last] <= '9' ) { $token .= $this->str[$this->last]; @@ -873,7 +873,7 @@ class Lexer extends Core } } elseif ($flags & Token::FLAG_SYMBOL_PARAMETER) { if ($this->last + 1 < $this->len) { - $this->last++; + ++$this->last; } } else { $token = ''; diff --git a/src/UtfString.php b/src/UtfString.php index 0d2e0c5..9ae70f6 100644 --- a/src/UtfString.php +++ b/src/UtfString.php @@ -75,7 +75,7 @@ class UtfString implements \ArrayAccess $this->byteIdx = 0; $this->charIdx = 0; $this->byteLen = mb_strlen($str, '8bit'); - if (! mb_check_encoding($str, 'UTF-8')) { + if (!mb_check_encoding($str, 'UTF-8')) { $this->charLen = 0; } else { $this->charLen = mb_strlen($str, 'UTF-8'); @@ -120,7 +120,7 @@ class UtfString implements \ArrayAccess while ($delta++ < 0) { do { $byte = ord($this->str[--$this->byteIdx]); - } while ((128 <= $byte) && ($byte < 192)); + } while (($byte >= 128) && ($byte < 192)); --$this->charIdx; } } diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index 393eaf3..df260e7 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -556,6 +556,7 @@ class Formatter } elseif ($this->options['type'] === 'cli') { if ($prev != $format['cli']) { $prev = $format['cli']; + return $format['cli'] . $this->escapeConsole($text); } @@ -569,6 +570,7 @@ class Formatter if ($this->options['type'] === 'cli') { if ($prev != "\x1b[39m") { $prev = "\x1b[39m"; + return "\x1b[39m" . $this->escapeConsole($text); } |