From 6de49666f3ab593728c8062858f57ea057792118 Mon Sep 17 00:00:00 2001
From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com>
Date: Mon, 2 Oct 2023 09:10:52 -0300
Subject: [PATCH] Fix minor corrections. (#3)
---
.github/workflows/mutation.yml | 31 -------------------------------
.github/workflows/static.yml | 2 +-
README.md | 18 ++++++++----------
composer.json | 18 ++++++++++++------
docs/testing.md | 12 ++----------
phpstan-yii-config.php | 5 +++++
phpstan.neon | 21 +++++++++++++++++++++
7 files changed, 49 insertions(+), 58 deletions(-)
delete mode 100644 .github/workflows/mutation.yml
create mode 100644 phpstan-yii-config.php
create mode 100644 phpstan.neon
diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml
deleted file mode 100644
index 1172d06..0000000
--- a/.github/workflows/mutation.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-on:
- pull_request:
- paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'CHANGELOG.md'
- - '.gitignore'
- - '.gitattributes'
- - 'psalm.xml'
-
- push:
- 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
- secrets:
- STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- with:
- os: >-
- ['ubuntu-latest']
- php: >-
- ['8.1']
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 58b5407..c8974c7 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -23,7 +23,7 @@ name: static analysis
jobs:
psalm:
- uses: yiisoft/actions/.github/workflows/psalm.yml@master
+ uses: php-forge/actions/.github/workflows/phpstan.yml@main
with:
os: >-
['ubuntu-latest']
diff --git a/README.md b/README.md
index e57a09b..306b746 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,17 @@
-
Template.
+ Yii2-Template.
+![php-version](https://img.shields.io/badge/php-%3E%3D8.1-787CB5)
+![yii2-version](https://img.shields.io/badge/yii2%20version-2.2-blue)
+[![build](https://github.com/yii2-extensions/template/actions/workflows/build.yml/badge.svg)](https://github.com/yii2-extensions/template/actions/workflows/build.yml)
+[![codecov](https://codecov.io/gh/yii2-extensions/template/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/yii2-extensions/template)
+[![static analysis](https://github.com/yii2-extensions/template/actions/workflows/static.yml/badge.svg)](https://github.com/yii2-extensions/template/actions/workflows/static.yml)
+[![StyleCI](https://github.styleci.io/repos/698621511/shield?branch=main)](https://github.styleci.io/repos/698621511?branch=main)
+
## Requirements
The minimun version of `PHP` required by this package is `PHP 8.1`.
@@ -20,15 +27,6 @@ For install this package, you need [composer](https://getcomposer.org/).
[Check the documentation testing](/docs/testing.md) to learn about testing.
-## CI status
-
-[![build](https://github.com/yii2-extensions/template/actions/workflows/build.yml/badge.svg)](https://github.com/yii2-extensions/template/actions/workflows/build.yml)
-[![codecov](https://codecov.io/gh/yii2-extensions/template/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/yii2-extensions/template)
-[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii2-extensions%2Ftemplate%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/yii2-extensions/template/main)
-[![static analysis](https://github.com/yii2-extensions/template/actions/workflows/static.yml/badge.svg)](https://github.com/yii2-extensions/template/actions/workflows/static.yml)
-[![type-coverage](https://shepherd.dev/github/yii2-extensions/template/coverage.svg)](https://shepherd.dev/github/yii2-extensions/template)
-[![StyleCI](https://github.styleci.io/repos/698621511/shield?branch=main)](https://github.styleci.io/repos/698621511?branch=main)
-
## Our social networks
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)
diff --git a/composer.json b/composer.json
index 24aa0ed..9f4beaf 100644
--- a/composer.json
+++ b/composer.json
@@ -9,13 +9,13 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
- "php": "^8.1"
+ "php": ">=8.1",
+ "yiisoft/yii2": "^2.2"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
"phpunit/phpunit": "^10.2",
- "roave/infection-static-analysis-plugin": "^1.32",
- "vimeo/psalm": "^5.1"
+ "proget-hq/phpstan-yii2": "^0.8.0"
},
"autoload": {
"psr-4": {
@@ -35,13 +35,19 @@
"config": {
"sort-packages": true,
"allow-plugins": {
- "infection/extension-installer": true
+ "yiisoft/yii2-composer": true
}
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin",
- "psalm": "psalm",
+ "phpstan": "phpstan",
"test": "phpunit"
- }
+ },
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://asset-packagist.org"
+ }
+ ]
}
diff --git a/docs/testing.md b/docs/testing.md
index 63478f7..46a4946 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -10,20 +10,12 @@ To run the checker, execute the following command:
composer run check-dependencies
```
-## Mutation testing
-
-Mutation testing is checked with [Infection](https://infection.github.io/). To run it:
-
-```shell
-composer run mutation
-```
-
## Static analysis
-The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
+The code is statically analyzed with [Phpstan](https://phpstan.org/). To run static analysis:
```shell
-composer run psalm
+composer run phpstan
```
## Unit tests
diff --git a/phpstan-yii-config.php b/phpstan-yii-config.php
new file mode 100644
index 0000000..0dae23d
--- /dev/null
+++ b/phpstan-yii-config.php
@@ -0,0 +1,5 @@
+