Skip to content

Commit

Permalink
Update dependencies and configuration files.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jan 18, 2024
1 parent 0e41bc3 commit be85f44
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 15 deletions.
34 changes: 34 additions & 0 deletions .github/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

name: ecs

jobs:
easy-coding-standard:
uses: php-forge/actions/.github/workflows/ecs.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2']
['8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1']
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1', '8.2', '8.3']
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
"license": "MIT",
"require": {
"php": "^8.1",
"phpunit/phpunit": "^10.2"
"phpunit/phpunit": "^10.5"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
"roave/infection-static-analysis-plugin": "^1.32",
"vimeo/psalm": "^5.1"
"maglnet/composer-require-checker": "^4.7",
"roave/infection-static-analysis-plugin": "^1.34",
"symplify/easy-coding-standard": "^12.1",
"vimeo/psalm": "^5.20"
},
"autoload": {
"psr-4": {
Expand All @@ -42,7 +43,11 @@
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin -j2 --only-covered",
"easy-coding-standard": "ecs --fix",
"mutation": [
"Composer\\Config::disableProcessTimeout",
"roave-infection-static-analysis-plugin --threads=2 --only-covered"
],
"psalm": "psalm",
"test": "phpunit"
}
Expand Down
47 changes: 47 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
]
);

// this way you add a single rule
$ecsConfig->rules(
[
OrderedClassElementsFixer::class,
OrderedTraitsFixer::class,
NoUnusedImportsFixer::class,
]
);

// this way you can add sets - group of rules
$ecsConfig->sets(
[
// run and fix, one by one
SetList::DOCBLOCK,
SetList::NAMESPACES,
SetList::COMMENTS,
SetList::PSR_12,
]
);

// this way configures a rule
$ecsConfig->ruleWithConfiguration(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
);
};
8 changes: 1 addition & 7 deletions tests/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ final class AssertTest extends TestCase
{
public function testEqualsWithoutLE(): void
{
Assert::equalsWithoutLE(
<<<Text
Foo
Bar
Text,
"Foo\nBar"
);
Assert::equalsWithoutLE('foo' . "\r\n" . 'bar', 'foo' . "\r\n" . 'bar');
}

public function testInaccessibleProperty(): void
Expand Down

0 comments on commit be85f44

Please sign in to comment.