Skip to content

Commit 0d74338

Browse files
committed
Improve php-cs-fixer config
1 parent 1ed9eaa commit 0d74338

17 files changed

Lines changed: 480 additions & 298 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
operating-system: [ubuntu-latest, windows-latest, macos-latest]
11-
php-versions: ['7.2', '7.3', '7.4', '8.0']
11+
php-versions: ['7.3', '7.4', '8.0']
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2

.php_cs.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ $config
3636
'@PHPUnit75Migration:risky' => true,
3737
'@Symfony' => true,
3838
'@PhpCsFixer' => true,
39-
'@PhpCsFixer:risky' => true,
4039
'binary_operator_spaces' => ['default' => 'align_single_space'],
4140
'align_multiline_comment' => true,
4241
'array_syntax' => ['syntax' => 'short'],
4342
'array_indentation' => true,
4443
'blank_line_before_return' => true,
4544
'header_comment' => ['header' => $header],
4645
'list_syntax' => ['syntax' => 'long'],
46+
'concat_space' => ['spacing' => 'one']
4747
])
4848
->setFinder($finder)
4949
;

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ setup:
66
build:
77
./vendor/bin/phplemon src/SQLParser/Parser.y || exit 0
88
php build.php
9-
./vendor/bin/php-cs-fixer fix src
9+
./vendor/bin/php-cs-fixer fix
1010
test:
1111
phpunit --coverage-html coverage

build.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
<?php
22

3+
/*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2015-2021 César Rodas
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
* -
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
* -
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
327
require __DIR__ . '/vendor/autoload.php';
428

529
use SQLParser\Lexer;
@@ -18,9 +42,8 @@
1842
1943
class ReservedWords
2044
{
21-
' . $constants ."
45+
' . $constants . "
2246
public static \$words = [\n" . $array . '];
2347
}';
2448

25-
2649
file_put_contents(__DIR__ . '/src/SQL/ReservedWords.php', $code);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
]
1818
},
1919
"requires": {
20-
"php": "^7.0 || ^8.0"
20+
"php": ">=7.3 || ^8.0"
2121
},
2222
"require-dev": {
2323
"crodas/phpunit-compat": "^1.7",

src/SQL/Statement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function setOptions(array $mods)
178178
}
179179

180180
if (\count($walk) > 1) {
181-
throw new RuntimeException('Invalid usage of '.implode(', ', $walk));
181+
throw new RuntimeException('Invalid usage of ' . implode(', ', $walk));
182182
}
183183
}
184184

src/SQL/TableDiff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getTable($sql)
128128
{
129129
$stmts = $this->parser->parse($sql);
130130
if (!($stmts[0] instanceof Table)) {
131-
throw new InvalidArgumentException('Expecting a CREATE TABLE Statement, got '.\get_class($stmts[0]).' class');
131+
throw new InvalidArgumentException('Expecting a CREATE TABLE Statement, got ' . \get_class($stmts[0]) . ' class');
132132
}
133133

134134
$table = array_shift($stmts);

0 commit comments

Comments
 (0)