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
33 changes: 12 additions & 21 deletions .github/workflows/bc.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
name: backwards compatibility

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
paths: &paths
- 'src/**'
- 'composer.json'
- '.github/workflows/bc.yml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

name: backwards compatibility
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
roave_bc_check:
uses: yiisoft/actions/.github/workflows/bc.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
['8.5']
34 changes: 14 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
name: build

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

paths: &paths
- 'src/**'
- 'tests/**'
- 'phpunit.xml.dist'
- 'composer.json'
- '.github/workflows/build.yml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: build
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
secrets:
codecovToken: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
os: >-
['ubuntu-latest', 'windows-latest']
Expand Down
33 changes: 12 additions & 21 deletions .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
name: Composer require checker

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

paths: &paths
- 'src/**'
- 'tests/**'
- 'composer.json'
- '.github/workflows/composer-require-checker.yml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

name: Composer require checker
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
composer-require-checker:
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: mutation test

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

paths: &paths
- 'src/**'
- 'tests/**'
- 'phpunit.xml.dist'
- 'infection.json.dist'
- 'composer.json'
- '.github/workflows/mutation.yml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

name: mutation test
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mutation:
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rector-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ concurrency:

jobs:
rector:
permissions:
contents: write # Required to push style fixes back to the branch
uses: yiisoft/actions/.github/workflows/rector-cs.yml@master
with:
php: '8.0'
33 changes: 13 additions & 20 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: static analysis

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

paths: &paths
- 'src/**'
- 'psalm.xml'
- 'composer.json'
- '.github/workflows/static.yml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

name: static analysis
paths: *paths

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
psalm:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1', '8.2', '8.3', '8.4']
['8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
20 changes: 10 additions & 10 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches:
- master
- main
paths:
- '.github/**.yml'
- '.github/**.yaml'
pull_request:
paths:
paths: &paths
- '.github/**.yml'
- '.github/**.yaml'
push:
branches: ['master']
paths: *paths

permissions:
actions: read # Required by zizmor when reading workflow metadata through the API.
contents: read # Required to read workflow files.
actions: read # Required by zizmor when reading workflow metadata through the API
contents: read # Required to read workflow files

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
zizmor:
Expand Down
21 changes: 4 additions & 17 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,20 @@

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use Yiisoft\CodeStyle\ConfigBuilder;

$finder = (new Finder())->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

return (new Config())
return ConfigBuilder::build()
->setRiskyAllowed(true)
->setParallelConfig(ParallelConfigFactory::detect())
->setRules([
'@PER-CS3.0' => true,
'no_unused_imports' => true,
'ordered_class_elements' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'declare_strict_types' => true,
'native_function_invocation' => true,
'native_constant_invocation' => true,
'fully_qualified_strict_types' => [
'import_symbols' => true
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'@Yiisoft/Core' => true,
'@Yiisoft/Core:risky' => true,
])
->setFinder($finder);
18 changes: 14 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
"php": "8.0 - 8.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.66",
"maglnet/composer-require-checker": "^4.4",
"bamarni/composer-bin-plugin": "^1.9.1",
"friendsofphp/php-cs-fixer": "^3.95",
"phpunit/phpunit": "^9.6.22",
"rector/rector": "^2.0.8",
"roave/infection-static-analysis-plugin": "^1.25",
"spatie/phpunit-watcher": "^1.23.6",
"vimeo/psalm": "^4.30 || ^5.26.1 || ^6.5"
"vimeo/psalm": "^4.30 || ^5.26.1 || ^6.5",
"yiisoft/code-style": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -54,11 +55,20 @@
"sort-packages": true,
"allow-plugins": {
"infection/extension-installer": true,
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"bamarni/composer-bin-plugin": true
}
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"target-directory": "tools",
"forward-command": true
}
},
"scripts": {
"cs-fix": "php-cs-fixer fix",
"rector": "rector",
"test": "phpunit --testdox --no-interaction",
"test-watch": "phpunit-watcher watch"
}
Expand Down
4 changes: 4 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;

return RectorConfig::configure()
->withPaths([
Expand All @@ -13,4 +14,7 @@
->withPhpSets(php80: true)
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withSkip([
ClosureToArrowFunctionRector::class,
]);
2 changes: 2 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*/vendor
/*/composer.lock
5 changes: 5 additions & 0 deletions tools/composer-require-checker/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"maglnet/composer-require-checker": "^4.4"
}
}
Loading