Skip to content

Commit 5c12a67

Browse files
committed
Fix CS and SC
1 parent 261def9 commit 5c12a67

16 files changed

Lines changed: 31 additions & 27 deletions

File tree

build/spell-checker/custom.dic

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ postgresql
3737
refman
3838
remstr
3939
rl
40+
rdf
4041
sdi
4142
sqlftw
4243
srs
4344
stm
45+
subdir
4446
tagname
4547
tbl
4648
termino
@@ -83,6 +85,7 @@ nonpersistible
8385
subgraph
8486
unresolvable
8587
uncastable
88+
serialisation
8689
casted
8790
backticks
8891
resize

sources/Analyzer/Rules/Charset/CharsetAndCollationCompatibilityRule.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use SqlFtw\Sql\Ddl\Table\CreateTableCommand;
2323
use SqlFtw\Sql\Ddl\Table\Option\TableOption;
2424
use SqlFtw\Sql\Expression\DefaultLiteral;
25-
use SqlFtw\Sql\MysqlVariable;
2625
use SqlFtw\Sql\Statement;
2726
use SqlFtw\Sql\TableCommand;
2827
use function count;
@@ -51,7 +50,7 @@ public function process(Statement $statement, SimpleContext $context, int $flags
5150
private function processSchema(SchemaCommand $command, SimpleContext $context): array
5251
{
5352
$results = [];
54-
$options = $command->getOptions();
53+
$options = $command->getOptions();
5554
$charset = $options->getCharset();
5655
$collation = $options->getCollation();
5756
if ($charset !== null && $collation !== null && !$charset->supportsCollation($collation)) {
@@ -68,7 +67,7 @@ private function processSchema(SchemaCommand $command, SimpleContext $context):
6867
private function processTable(TableCommand $command, SimpleContext $context): array
6968
{
7069
$results = [];
71-
$options = $command->getOptions();
70+
$options = $command->getOptions();
7271
/** @var Charset|DefaultLiteral $charset */
7372
$charset = $options->get(TableOption::CHARACTER_SET);
7473
if ($charset instanceof DefaultLiteral) {

sources/Parser/Dal/TableMaintenanceCommandsParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace SqlFtw\Parser\Dal;
1111

1212
use SqlFtw\Parser\TokenList;
13-
use SqlFtw\Sql\Dal\Table\AnalyzeTableDropHistogramCommand;
1413
use SqlFtw\Sql\Dal\Table\AnalyzeTableCommand;
14+
use SqlFtw\Sql\Dal\Table\AnalyzeTableDropHistogramCommand;
1515
use SqlFtw\Sql\Dal\Table\AnalyzeTableUpdateHistogramCommand;
1616
use SqlFtw\Sql\Dal\Table\ChecksumTableCommand;
1717
use SqlFtw\Sql\Dal\Table\CheckTableCommand;

sources/Parser/Ddl/IndexCommandsParser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use SqlFtw\Sql\Keyword;
2727
use SqlFtw\Sql\Order;
2828
use SqlFtw\Sql\SqlMode;
29+
use function count;
2930
use function strlen;
3031
use function strtoupper;
3132

sources/Parser/Dml/XaTransactionCommandsParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function parseXid(TokenList $tokenList): Xid
106106
if ($tokenList->hasSymbol(',')) {
107107
$format = $tokenList->expectIntLike();
108108
if (!$format instanceof UintLiteral && !$format instanceof HexadecimalLiteral) {
109-
throw new ParserException('Transaction format id must be unsigned int or hexadecimal literal.', $tokenList);
109+
throw new ParserException('Transaction format id must be unsigned int or hexadecimal literal.', $tokenList);
110110
}
111111
if ($format instanceof UintLiteral && (float) $format->getValue() >= (float) PHP_INT_MAX) {
112112
throw new ParserException('Transaction format id is too big.', $tokenList);

sources/Parser/RoutineBodyParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private function parseStatement(TokenList $tokenList): Statement
242242
$delimiter = $tokenList->get(TokenType::DELIMITER);
243243
if ($delimiter !== null) {
244244
$tokenList->appendTrailingDelimiter($delimiter->value);
245-
} {
245+
} else {
246246
if ($tokenList->hasSymbol(';')) {
247247
$tokenList->appendTrailingDelimiter(';');
248248
}

sources/Parser/exceptions/AnalyzerException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(array $results, Command $command, TokenList $tokenLi
3333
{
3434
$count = count($results);
3535
parent::__construct("Static analysis failed with $count errors.", $previous);
36-
rd($results);
36+
3737
$this->results = $results;
3838
$this->command = $command;
3939
$this->tokenList = $tokenList;

sources/Platform/Features/MysqlFeatures.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
use SqlFtw\Sql\Dal\Show\ShowTableStatusCommand;
5858
use SqlFtw\Sql\Dal\Show\ShowTriggersCommand;
5959
use SqlFtw\Sql\Dal\Show\ShowVariablesCommand;
60-
use SqlFtw\Sql\Dal\Table\AnalyzeTableDropHistogramCommand;
6160
use SqlFtw\Sql\Dal\Table\AnalyzeTableCommand;
61+
use SqlFtw\Sql\Dal\Table\AnalyzeTableDropHistogramCommand;
6262
use SqlFtw\Sql\Dal\Table\AnalyzeTableUpdateHistogramCommand;
6363
use SqlFtw\Sql\Dal\Table\ChecksumTableCommand;
6464
use SqlFtw\Sql\Dal\Table\OptimizeTableCommand;

sources/Session/Session.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use SqlFtw\Platform\Platform;
1313
use SqlFtw\Sql\Charset;
1414
use SqlFtw\Sql\Collation;
15-
use SqlFtw\Sql\EntityType;
1615
use SqlFtw\Sql\Expression\UnresolvedExpression;
1716
use SqlFtw\Sql\Expression\Value;
1817
use SqlFtw\Sql\MysqlVariable;

sources/Sql/Ddl/Schema/SchemaOptions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use SqlFtw\Sql\Charset;
1414
use SqlFtw\Sql\Collation;
1515
use SqlFtw\Sql\Ddl\Table\Option\ThreeStateValue;
16+
use function implode;
1617

1718
class SchemaOptions implements SchemaCommand
1819
{

0 commit comments

Comments
 (0)