Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor corrections. #3

Merged
merged 4 commits into from
Oct 2, 2023
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
31 changes: 0 additions & 31 deletions .github/workflows/mutation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
<a href="https://github.com/yii2-extensions/template" target="_blank">
<img src="https://www.yiiframework.com/image/yii_logo_light.svg" height="100px;">
</a>
<h1 align="center">Template.</h1>
<h1 align="center">Yii2-Template.</h1>
<br>
</p>

![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`.
Expand All @@ -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)
Expand Down
18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
]
}
12 changes: 2 additions & 10 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions phpstan-yii-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

declare(strict_types=1);

return [];
21 changes: 21 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
includes:
- vendor/proget-hq/phpstan-yii2/extension.neon
parameters:
dynamicConstantNames:
- YII_DEBUG
- YII_ENV
- YII_ENV_DEV
- YII_ENV_PROD
- YII_ENV_TEST

level: 2

paths:
- src

scanFiles:
- vendor/yiisoft/yii2/Yii.php

yii2:
config_path: %currentWorkingDirectory%/phpstan-yii-config.php