Skip to content

Commit 986bd72

Browse files
authored
Merge pull request #57 from wikimedia/slevomat-update
Update slevomat/coding-standard and fix issues
2 parents bfcd097 + 21660ef commit 986bd72

8 files changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,28 @@ on:
1111
jobs:
1212
build:
1313

14+
strategy:
15+
matrix:
16+
php: [ '7.4', '8.0', '8.1' ]
17+
1418
runs-on: ubuntu-latest
1519

1620
steps:
1721
- name: Checkout
18-
uses: actions/checkout@v1
22+
uses: actions/checkout@v3
1923

2024
- name: ShellCheck
21-
uses: ludeeus/action-shellcheck@1.0.0
25+
uses: ludeeus/action-shellcheck@master
2226
with:
2327
scandir: './bin'
2428

2529
- name: Set up PHP
2630
uses: shivammathur/setup-php@v2
2731
with:
28-
php-version: 7.2
32+
php-version: ${{matrix.php}}
2933

3034
- name: Test
3135
run: |
3236
composer install
33-
./vendor/bin/phpcs
37+
./vendor/bin/phpcs -s
3438
SYMFONY_DEPRECATIONS_HELPER=disabled ./vendor/bin/simple-phpunit

Command/SshCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Wikimedia\ToolforgeBundle\Command;

Logger/WebRequestProcessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Wikimedia\ToolforgeBundle\Logger;

Resources/phpcs/ruleset.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
<!-- Slevomat standards; see https://github.com/slevomat/coding-standard -->
66
<config name="installed_paths" value="../../slevomat/coding-standard"/><!-- relative path from PHPCS source location -->
7-
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
8-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessDocComment"/>
7+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
8+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation" />
9+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessSuppress" />
910
</rule>
1011
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
1112
<exclude

Service/ReplicasClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Wikimedia\ToolforgeBundle\Service;

Tests/Service/ReplicasClientTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Wikimedia\ToolforgeBundle\Tests\Service;

Twig/Extension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function ($filename) {
195195
* Whether the current (or specified) language is right-to-left.
196196
* @param string|bool $lang Language code (if false, will use current language).
197197
* @return bool
198+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
198199
*/
199200
public function isRtl($lang = false): bool
200201
{
@@ -268,6 +269,7 @@ public function getFilters(): array
268269
* @param int|float $number
269270
* @param int $decimals Number of decimals to format to.
270271
* @return string
272+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
271273
*/
272274
public function numberFormat($number, int $decimals = 0): string
273275
{

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737
"symfony/console": "^4.4|^5.2"
3838
},
3939
"require-dev": {
40-
"slevomat/coding-standard": "^4.8",
40+
"slevomat/coding-standard": "^8.0",
4141
"symfony/phpunit-bridge": "^4.4"
42+
},
43+
"config": {
44+
"allow-plugins": {
45+
"dealerdirect/phpcodesniffer-composer-installer": false
46+
}
4247
}
4348
}

0 commit comments

Comments
 (0)