diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
deleted file mode 100644
index 0726080..0000000
--- a/.github/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,102 +0,0 @@
-# Yii Contributor Code of Conduct
-
-## Our Pledge
-
-As contributors and maintainers of this project, and in order to keep Yii community open and welcoming, we ask to
-respect all community members.
-
-## Our Standards
-
-Examples of behavior that contributes to a positive environment for our community include:
-
-- Demonstrating empathy and kindness toward other people
-- Being respectful of differing opinions, viewpoints, and experiences
-- Giving and gracefully accepting constructive feedback
-- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
-- Focusing on what is best not just for us as individuals, but for the overall community
-
-Examples of unacceptable behavior by participants include:
-
-- The use of sexualized language or imagery, and sexual attention or advances of any kind
-- Trolling, insulting or derogatory comments, and personal or political attacks
-- Public or private harassment
-- Publishing others' private information, such as a physical or email address, without their explicit permission
-- Other conduct which could reasonably be considered inappropriate in a professional setting
-
-## Enforcement Responsibilities
-
-Core team members are responsible for clarifying and enforcing our standards of acceptable behavior and will take
-appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
-or harmful.
-
-Core team members have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
-issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
-moderation decisions when appropriate.
-
-## Scope
-
-This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
-the community in public spaces. Examples of representing a project or community include using an official e-mail
-address, posting via an official social media account, within project GitHub, official forum or acting as an appointed
-representative at an online or offline event.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting core team members. All
-complaints will be reviewed and investigated promptly and fairly.
-
-All core team members are obligated to respect the privacy and security of the reporter of any incident.
-
-## Enforcement Guidelines
-
-Core team members will follow these Community Impact Guidelines in determining the consequences for any action they
-deem in violation of this Code of Conduct:
-
-### 1. Correction
-
-**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in
-the community.
-
-**Consequence**: A private, written warning from core team members, providing clarity around the nature of the violation
-and an explanation of why the behavior was inappropriate. A public apology may be requested.
-
-### 2. Warning
-
-**Community Impact**: A violation through a single incident or series of actions.
-
-**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
-unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
-interactions in community spaces as well as external channels like social media. Violating these terms may lead to
-a temporary or permanent ban.
-
-### 3. Temporary Ban
-
-**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
-
-**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
-period of time. No public or private interaction with the people involved, including unsolicited interaction with those
-enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
-
-### 4. Permanent Ban
-
-**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
-behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
-
-**Consequence**: A permanent ban from any sort of public interaction within the community.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at
-[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
-
-Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
-
-For answers to common questions about this code of conduct, see the FAQ at
-[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
-[https://www.contributor-covenant.org/translations][translations].
-
-[homepage]: https://www.contributor-covenant.org
-[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
-[Mozilla CoC]: https://github.com/mozilla/diversity
-[FAQ]: https://www.contributor-covenant.org/faq
-[translations]: https://www.contributor-covenant.org/translations
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 4d2bbb0..0000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,20 +0,0 @@
-## ✔️ Check all applicable options or remove those that do not apply
-| Q | A
-| ------------- | ---
-| Is bugfix? | ✔️/❌
-| New feature? | ✔️/❌
-| Breaks BC? | ✔️/❌
-| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
-
-
-## ✍ Describe your PR in detail
-
-
-
-
-
-## 📷 Screenshots - If you wish, attach an image to help us better understand the idea
-
-
-
-
diff --git a/.github/workflows/bc.yml_ b/.github/workflows/bc.yml
similarity index 91%
rename from .github/workflows/bc.yml_
rename to .github/workflows/bc.yml
index b269391..a9fffcf 100644
--- a/.github/workflows/bc.yml_
+++ b/.github/workflows/bc.yml
@@ -6,7 +6,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
push:
@@ -17,7 +16,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 05e7b40..b51c8b2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -6,7 +6,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'psalm.xml'
push:
@@ -17,7 +16,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'psalm.xml'
name: build
@@ -31,4 +29,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
- ['8.1', '8.2', '8.3']
+ ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml
index a857bce..69d2329 100644
--- a/.github/workflows/composer-require-checker.yml
+++ b/.github/workflows/composer-require-checker.yml
@@ -6,7 +6,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
@@ -18,7 +17,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
@@ -31,4 +29,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
- ['8.1', '8.2', '8.3']
+ ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml
deleted file mode 100644
index 8150499..0000000
--- a/.github/workflows/mutation.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-on:
- pull_request:
- paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'CHANGELOG.md'
- - '.gitignore'
- - '.gitattributes'
- - 'psalm.xml'
-
- push:
- branches: ['master']
- paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'CHANGELOG.md'
- - '.gitignore'
- - '.gitattributes'
- - 'psalm.xml'
-
-name: mutation test
-
-jobs:
- mutation:
- uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
- with:
- os: >-
- ['ubuntu-latest']
- php: >-
- ['8.2']
- secrets:
- STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
diff --git a/.github/workflows/rector-cs.yml b/.github/workflows/rector-cs.yml
index 6424c2a..2be4d4e 100644
--- a/.github/workflows/rector-cs.yml
+++ b/.github/workflows/rector-cs.yml
@@ -24,4 +24,4 @@ jobs:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
- php: '8.1'
+ php: '7.4'
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index e33eca8..0e4411a 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -6,7 +6,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
push:
@@ -17,7 +16,6 @@ on:
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- - 'infection.json.dist'
- 'phpunit.xml.dist'
name: static analysis
@@ -29,4 +27,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
- ['8.1', '8.2', '8.3']
+ ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
diff --git a/.gitignore b/.gitignore
index d3b3a3d..6fbafc0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,7 +25,7 @@ composer.phar
# PhpUnit
/phpunit.phar
/phpunit.xml
-/.phpunit.cache
+/.phpunit.result.cache
# PHP CS Fixer
/.php-cs-fixer.cache
diff --git a/.phpunit-watcher.yml b/.phpunit-watcher.yml
deleted file mode 100644
index 035a80a..0000000
--- a/.phpunit-watcher.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-watch:
- directories:
- - src
- - tests
- fileMask: '*.php'
-notifications:
- passingTests: false
- failingTests: false
-phpunit:
- binaryPath: vendor/bin/phpunit
- timeout: 180
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a8fbfe..8ee4e9e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# _____ Change Log
+# Yii Code Style Change Log
## 1.0.0 under development
diff --git a/README.md b/README.md
index bf2078c..a954489 100644
--- a/README.md
+++ b/README.md
@@ -10,16 +10,16 @@
[](https://packagist.org/packages/yiisoft/code-style)
[](https://github.com/yiisoft/code-style/actions/workflows/build.yml?query=branch%3Amaster)
[](https://codecov.io/gh/yiisoft/code-style)
-[](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/code-style/master)
[](https://github.com/yiisoft/code-style/actions/workflows/static.yml?query=branch%3Amaster)
[](https://shepherd.dev/github/yiisoft/code-style)
[](https://shepherd.dev/github/yiisoft/code-style)
-Package for code style control. Contains rule sets for [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer).
+A package that provides [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) rule sets for enforcing code style
+in Yii packages.
## Requirements
-- PHP 8.1 or higher.
+- PHP 7.4 or higher.
## Installation
@@ -86,3 +86,7 @@ Maintained by [Yii Software](https://www.yiiframework.com/).
[](https://t.me/yii3en)
[](https://www.facebook.com/groups/yiitalk)
[](https://yiiframework.com/go/slack)
+
+## Credits
+
+The package is inspired by [spiral/code-style](https://github.com/spiral/code-style) repository.
diff --git a/composer.json b/composer.json
index bd8b9fc..eccb75b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "yiisoft/code-style",
"type": "library",
- "description": "Code style tools rulesets collection",
+ "description": "PHP CS Fixer rule sets for Yii packages",
"keywords": [
"yii",
"code style"
@@ -26,18 +26,14 @@
"url": "https://github.com/sponsors/yiisoft"
}
],
- "minimum-stability": "dev",
- "prefer-stable": true,
"require": {
- "php": "^8.1",
+ "php": "^7.4 || ^8.0",
"friendsofphp/php-cs-fixer": "^3.92.5"
},
"require-dev": {
- "maglnet/composer-require-checker": "^4.7.1",
- "phpunit/phpunit": "^10.5.46",
- "rector/rector": "^2.0.16",
- "roave/infection-static-analysis-plugin": "^1.35",
- "spatie/phpunit-watcher": "^1.24",
+ "maglnet/composer-require-checker": "^3.8.0 || ^4.7.1",
+ "phpunit/phpunit": "^9.6.31",
+ "rector/rector": "^2.3.4",
"vimeo/psalm": "^5.26.1 || ^6.10.3"
},
"autoload": {
@@ -53,13 +49,11 @@
"config": {
"sort-packages": true,
"allow-plugins": {
- "infection/extension-installer": true,
"composer/package-versions-deprecated": true
}
},
"scripts": {
- "test": "phpunit --testdox --no-interaction",
- "test-watch": "phpunit-watcher watch",
+ "test": "phpunit",
"cs-fix": "php-cs-fixer fix"
}
}
diff --git a/docs/internals.md b/docs/internals.md
index 30f70c0..a51bbd3 100644
--- a/docs/internals.md
+++ b/docs/internals.md
@@ -8,15 +8,6 @@ The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
./vendor/bin/phpunit
```
-## Mutation testing
-
-The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
-[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
-
-```shell
-./vendor/bin/roave-infection-static-analysis-plugin
-```
-
## Static analysis
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
@@ -27,6 +18,12 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static
## Code style
+Package used [PHP CS Fixer](https://cs.symfony.com/) to maintain Yii code style. To check and fix code style:
+
+```shell
+composer cs-fix
+```
+
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
use either newest or any specific version of PHP:
diff --git a/infection.json.dist b/infection.json.dist
deleted file mode 100644
index 3776e22..0000000
--- a/infection.json.dist
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "source": {
- "directories": [
- "src"
- ]
- },
- "logs": {
- "text": "php:\/\/stderr",
- "stryker": {
- "report": "master"
- }
- },
- "mutators": {
- "@default": true
- }
-}
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 7f0a8fe..8f2359e 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -1,21 +1,21 @@
-
+
@@ -24,9 +24,9 @@
-
+
- ./src
+ src
-
+
diff --git a/psalm.xml b/psalm.xml
index da5a4cb..77a366b 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -1,6 +1,6 @@
registerCustomRuleSets([
new YiisoftCoreSet(),
new YiisoftCoreRiskySet(),