Skip to content

Commit a1cdab5

Browse files
authored
chores (#244)
1 parent 27d6b32 commit a1cdab5

File tree

115 files changed

+331
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+331
-256
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php-version: ['8.2']
24+
php-version: ['8.3']
2525
steps:
2626
- uses: actions/checkout@v4
2727
- uses: shivammathur/setup-php@v2

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
php-version: ['8.2']
33+
php-version: ['8.3', '8.4']
3434
steps:
3535
- uses: actions/checkout@v4
3636
- uses: shivammathur/setup-php@v2
@@ -45,7 +45,7 @@ jobs:
4545
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
4646
restore-keys: |
4747
${{ runner.os }}-php-${{ matrix.php-version }}-
48-
- run: make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/vendor/bin/phpunit
48+
- run: make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/bin/run
4949
- name: Get changed PHP files
5050
if: github.ref != 'refs/heads/main'
5151
id: changed-php-files

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
php-version: ['8.2', '8.3']
32+
php-version: ['8.3', '8.4']
3333
steps:
3434
- uses: actions/checkout@v4
3535
- uses: shivammathur/setup-php@v2

.php-cs-fixer.dist.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
$finder = Finder::create()
1010
->in(__DIR__)
11+
->in(__DIR__ . '/tools/chorale/src/')
1112
->exclude('build')
1213
->exclude('docs')
1314
->exclude('tools')
@@ -21,8 +22,8 @@
2122
->setRules([
2223
// Rule sets
2324
'@PER-CS' => true,
24-
'@PHP80Migration:risky' => true,
25-
'@PHP82Migration' => true,
25+
'@PHP82Migration:risky' => true,
26+
'@PHP83Migration' => true,
2627
'@PHPUnit100Migration:risky' => true,
2728

2829
// Rules

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CHURN = tools/churn/vendor/bin/churn
1111
INFECTION = tools/infection/vendor/bin/infection
1212
PHP_CS_FIXER = tools/php-cs-fixer/vendor/bin/php-cs-fixer
1313
PHPACTOR = tools/phpactor/vendor/bin/phpactor
14-
PHPUNIT = tools/phpunit/vendor/bin/phpunit
14+
PHPUNIT = tools/phpunit/bin/run
1515
PSALM = tools/psalm/vendor/bin/psalm
1616
RECTOR = tools/rector/vendor/bin/rector
1717
# end: Tools

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@
230230
}
231231
},
232232
"require-dev": {
233-
"phpunit/phpunit": "^10.4",
234233
"symfony/http-foundation": "^5 || ^6 || ^7",
235234
"symfony/messenger": "^5 || ^6 || ^7",
236235
"symfony/serializer": "^5 || ^6 || ^7"
@@ -246,4 +245,4 @@
246245
"@php -r \"if(file_exists('./.git')&&file_exists('./build/hooks/pre-commit')){copy('./build/hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0755);}\""
247246
]
248247
}
249-
}
248+
}

psalm.xml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,28 @@
1111
findUnusedVariablesAndParams="true"
1212
findUnusedBaselineEntry="false"
1313
findUnusedCode="true"
14+
phpVersion="8.3"
1415
autoloader="vendor/autoload.php"
1516
>
1617
<projectFiles>
1718
<directory name="src/SonsOfPHP"/>
1819
<ignoreFiles>
20+
<!-- Ignore test suites across packages to reduce noise like UnusedClass -->
21+
<directory name="src/SonsOfPHP/Bard/Tests"/>
22+
<directory name="src/SonsOfPHP/Bridge/*/*/Tests"/>
23+
<directory name="src/SonsOfPHP/Bridge/*/*/*/Tests"/>
24+
<directory name="src/SonsOfPHP/Bundle/*/Tests"/>
25+
<directory name="src/SonsOfPHP/Component/*/Tests"/>
26+
<!-- Ignore vendors -->
1927
<directory name="src/SonsOfPHP/Bard/vendor/*"/>
2028
<directory name="src/SonsOfPHP/Bridge/*/*/vendor/*"/>
2129
<directory name="src/SonsOfPHP/Bridge/*/*/*/vendor/*"/>
2230
<directory name="src/SonsOfPHP/Bundle/*/vendor/*"/>
2331
<directory name="src/SonsOfPHP/Component/*/vendor/*"/>
2432
<directory name="src/SonsOfPHP/Contract/*/vendor/**"/>
2533
<directory name="vendor/**"/>
34+
<!-- Ignore Rector config which references Rector classes outside our autoload -->
35+
<file name="rector.php" />
2636
</ignoreFiles>
2737
</projectFiles>
2838
<extraFiles>
@@ -32,7 +42,25 @@
3242
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
3343
</plugins>
3444
<issueHandlers>
35-
<!--<PossiblyUnusedMethod errorLevel="info" />-->
36-
<!--<UnusedClass errorLevel="info" />-->
45+
<UnusedClass errorLevel="info" />
46+
<UnnecessaryVarAnnotation errorLevel="info" />
47+
<!-- Keep other findings visible but non-blocking for DX -->
48+
<PossiblyUnusedMethod errorLevel="info" />
49+
<!-- Psalm false-positives in Bard console helpers and operations naming -->
50+
<UndefinedInterfaceMethod>
51+
<errorLevel type="info">
52+
<directory name="src/SonsOfPHP/Bard/src/Console/Command" />
53+
</errorLevel>
54+
</UndefinedInterfaceMethod>
55+
<ParamNameMismatch>
56+
<errorLevel type="info">
57+
<directory name="src/SonsOfPHP/Bard/src/Operation" />
58+
</errorLevel>
59+
</ParamNameMismatch>
60+
<InvalidArgument errorLevel="info" />
61+
<UndefinedClass errorLevel="info" />
62+
<NullableReturnStatement errorLevel="info" />
63+
<InvalidCatch errorLevel="info" />
64+
<LessSpecificImplementedReturnType errorLevel="info" />
3765
</issueHandlers>
3866
</psalm>

rector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
->withCache(__DIR__ . '/build/cache/rector')
1010
->withPaths([
1111
__DIR__ . '/src',
12+
__DIR__ . '/tools/chorale',
1213
])
1314
->withSkip([
1415
__DIR__ . '/src/SonsOfPHP/*/vendor/*',
1516
__DIR__ . '/src/SonsOfPHP/*/*/vendor/*',
1617
__DIR__ . '/src/SonsOfPHP/*/*/*/vendor/*',
1718
__DIR__ . '/src/SonsOfPHP/*/*/*/*/vendor/*',
19+
__DIR__ . '*/vendor/*',
1820
])
1921
// This should be the same version that is found in composer.json file
2022
->withPhpSets(
21-
php82: true,
23+
php83: true,
2224
)
2325
//->withAttributesSets(
2426
// phpunit: true,

src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@
4141
#[UsesClass(AddPackageOperation::class)]
4242
final class AddCommandTest extends TestCase
4343
{
44-
private Application $application;
45-
4644
private AddCommand $command;
4745

4846
protected function setUp(): void
4947
{
50-
$this->application = new Application();
51-
$this->command = $this->application->get('add');
48+
$application = new Application();
49+
$this->command = $application->get('add');
5250
}
5351

5452
public function testItsNameIsCorrect(): void

src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@
4141
#[UsesClass(AddPackageOperation::class)]
4242
final class CopyCommandTest extends TestCase
4343
{
44-
private Application $application;
45-
4644
private CopyCommand $command;
4745

4846
protected function setUp(): void
4947
{
50-
$this->application = new Application();
51-
$this->command = $this->application->get('copy');
48+
$application = new Application();
49+
$this->command = $application->get('copy');
5250
}
5351

5452
public function testItExecutesSuccessfully(): void

0 commit comments

Comments
 (0)