Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Define shared matrix values
id: matrix
run: |
echo 'php_versions=["8.3","8.4","8.5"]' >> "$GITHUB_OUTPUT"
echo 'php_versions=["8.4","8.5"]' >> "$GITHUB_OUTPUT"
echo 'dependency_versions=["prefer-lowest","prefer-stable"]' >> "$GITHUB_OUTPUT"

run:
Expand Down Expand Up @@ -57,7 +57,9 @@ jobs:
composer test:code
composer test:lint
composer test:refactor
# Skip Psalm on prefer-lowest: older transitive amphp versions can trigger PHP 8.4+ deprecations at startup.
if [ "${{ matrix.dependency-version }}" != "prefer-lowest" ]; then
composer test:static
fi
if [ "${{ matrix.dependency-version }}" != "prefer-lowest" ]; then
composer test:security
fi
Expand Down
4 changes: 0 additions & 4 deletions captainhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
"action": "composer audit",
"options": []
},
{
"action": "composer test:security",
"options": []
},
{
"action": "composer tests",
"options": []
Expand Down
21 changes: 8 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,15 @@
}
},
"scripts": {
"test:code": "@php vendor/bin/pest --parallel --processes=10",
"test:security": "@php vendor/bin/psalm --config=psalm.xml --security-analysis --show-info=false --no-progress --threads=1",
"test:refactor": "@php vendor/bin/rector process --dry-run",
"test:lint": "@php vendor/bin/pint --test",
"test:hook": [
"captainhook hook:post-checkout",
"captainhook hook:pre-commit",
"captainhook hook:post-commit",
"captainhook hook:post-merge",
"captainhook hook:post-rewrite",
"captainhook hook:pre-push"
],
"test:code": "@php -d error_reporting=24575 vendor/bin/pest --parallel --processes=10",
"test:security": "@php -d error_reporting=24575 vendor/bin/psalm --config=psalm.xml --security-analysis --show-info=false --no-progress --threads=1",
"test:static": "@php -d error_reporting=24575 vendor/bin/phpstan analyse --configuration=phpstan.neon.dist --memory-limit=1G --no-progress",
"test:refactor": "@php -d error_reporting=24575 vendor/bin/rector process --dry-run",
"test:lint": "@php -d error_reporting=24575 vendor/bin/pint --test",
"tests": [
"@test:code",
"@test:lint",
"@test:static",
"@test:refactor",
"@test:security"
],
Expand All @@ -72,6 +66,7 @@
"pestphp/pest-plugin-drift": "^4.1",
"rector/rector": "^2.3.9",
"symfony/var-dumper": "^7.3 || ^8.0.8",
"vimeo/psalm": "^6.16.1"
"vimeo/psalm": "^6.16.1",
"tomasvotruba/cognitive-complexity": "^1.1"
}
}
34 changes: 21 additions & 13 deletions pest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<pest>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
<testsuite name="Integration">
<directory>tests/Integration</directory>
</testsuite>
</testsuites>
</pest>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="tests">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<coverage includeUncoveredFiles="true"/>
<php>
<ini name="error_reporting" value="24575"/>
</php>
</phpunit>
12 changes: 9 additions & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
includes:
- vendor/tomasvotruba/cognitive-complexity/config/extension.neon

parameters:
level: 3
customRulesetUsed: true
paths:
- src
- tests
tmpDir: var/phpstan
parallel:
maximumNumberOfProcesses: 1
cognitive_complexity:
class: 150
function: 15
dependency_tree: 150
dependency_tree_types: []
34 changes: 20 additions & 14 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
</source>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
displayDetailsOnTestsThatTriggerWarnings="true">
<testsuites>
<testsuite name="tests">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<coverage includeUncoveredFiles="true"/>
<php>
<ini name="error_reporting" value="24575"/>
</php>
</phpunit>
3 changes: 1 addition & 2 deletions pint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"preset": "psr12",
"exclude": [
"tests",
"var"
"tests"
],
"notPath": [
"rector.php"
Expand Down
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="3"
cacheDirectory=".psalm-cache"
>
<projectFiles>
<directory name="src" />
Expand Down
8 changes: 4 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__ . '/src']);
$rectorConfig->paths([__DIR__.'/src']);

$setConstant = SetList::class . '::PHP_' . PHP_MAJOR_VERSION . PHP_MINOR_VERSION;
if (!defined($setConstant)) {
$setConstant = SetList::class . '::PHP_84';
$setConstant = SetList::class.'::PHP_'.PHP_MAJOR_VERSION.PHP_MINOR_VERSION;
if (! defined($setConstant)) {
$setConstant = SetList::class.'::PHP_84';
}

$rectorConfig->sets([
Expand Down
Loading