Skip to content

Commit ac798ab

Browse files
committed
chore: update metafiles, configure PHPUnit
1 parent f16b75b commit ac798ab

File tree

6 files changed

+50
-5
lines changed

6 files changed

+50
-5
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/psalm.* export-ignore
77
/psalm-baseline.xml export-ignore
88
/infection.* export-ignore
9+
/rector.php export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.*
22
!/.github/
3+
!/.php-cs-fixer.dist.php
34
/runtime/
45
/vendor/
56
/.env

.php-cs-fixer.dist.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require_once 'vendor/autoload.php';
6+
7+
return \Spiral\CodeStyle\Builder::create()
8+
->include(__DIR__ . '/src')
9+
->include(__DIR__ . '/tests')
10+
->include(__DIR__ . '/rector.php')
11+
->include(__FILE__)
12+
->allowRisky(false)
13+
->build();

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"require-dev": {
3535
"buggregator/trap": "^1.13",
3636
"phpunit/phpunit": "^10.5.10",
37+
"rector/rector": "^2.1",
3738
"spiral/code-style": "^2.2",
3839
"ta-tikoma/phpunit-architecture-test": "^0.8.5",
3940
"vimeo/psalm": "^6.13"
@@ -65,6 +66,8 @@
6566
"psalm": "psalm",
6667
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
6768
"psalm:ci": "psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
69+
"refactor": "rector process --config=rector.php",
70+
"refactor:ci": "rector process --config=rector.php --dry-run --ansi",
6871
"test": "phpunit --color=always --testdox",
6972
"test:cc": [
7073
"@putenv XDEBUG_MODE=coverage",

phpunit.xml.dist

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,35 @@
22

33
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7+
cacheResultFile="runtime/phpunit/result.cache"
78
cacheResult="false"
89
colors="true"
9-
convertDeprecationsToExceptions="true">
10+
>
1011
<testsuites>
1112
<testsuite name="Promise Test Suite">
1213
<directory>./tests/</directory>
1314
</testsuite>
1415
</testsuites>
1516
<coverage>
17+
<report>
18+
<html outputDirectory="runtime/coverage"/>
19+
<text outputFile="runtime/coverage.txt"/>
20+
<clover outputFile="runtime/logs/clover.xml"/>
21+
</report>
22+
</coverage>
23+
<logging>
24+
<junit outputFile="runtime/report.junit.xml"/>
25+
</logging>
26+
<source>
1627
<include>
17-
<directory>./src/</directory>
28+
<directory>src</directory>
1829
</include>
1930
<exclude>
20-
<file>./src/functions_include.php</file>
31+
<directory>tests</directory>
2132
</exclude>
22-
</coverage>
33+
</source>
2334
<php>
2435
<ini name="error_reporting" value="-1" />
2536
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->

rector.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
// uncomment to reach your current PHP version
13+
// ->withPhpSets(php81: true)
14+
->withTypeCoverageLevel(0)
15+
->withDeadCodeLevel(0)
16+
->withCodeQualityLevel(0);

0 commit comments

Comments
 (0)