Skip to content

Commit 881e87f

Browse files
authored
Merge pull request #113 from kubawerlos/add-infection
Add Infection
2 parents cfcae20 + 8c00e7b commit 881e87f

File tree

7 files changed

+35
-6
lines changed

7 files changed

+35
-6
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/src-dev/ export-ignore
33
/tests/ export-ignore
44
/.* export-ignore
5+
/infection.json.dist export-ignore
56
/phpmd.xml export-ignore
67
/phpstan.neon.dist export-ignore
78
/phpunit.xml.dist export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
/.php_cs.cache
44
/.phpunit.result.cache
55
/composer.lock
6+
/infection.json
7+
/infection.log
68
/phpunit.xml
79
/psalm.xml

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jobs:
5353
echo "extension=pcov.so" > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/pcov.ini
5454
cd $TRAVIS_BUILD_DIR
5555
install: composer require --dev php-coveralls/php-coveralls
56-
script: composer test -- --coverage-clover=./build/logs/clover.xml
56+
script:
57+
- composer test -- --coverage-clover=./build/logs/clover.xml
58+
- vendor/bin/infection run --threads=16
5759
after_success: ./vendor/bin/php-coveralls
5860

5961
- php: '7.4snapshot'

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
55
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
66
![Repository size](https://github-size-badge.herokuapp.com/kubawerlos/php-cs-fixer-custom-fixers.svg)
7+
[![Last commit](https://img.shields.io/github/last-commit/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/commits)
78

89
[![Build status](https://img.shields.io/travis/kubawerlos/php-cs-fixer-custom-fixers/master.svg)](https://travis-ci.org/kubawerlos/php-cs-fixer-custom-fixers)
910
[![Code coverage](https://img.shields.io/coveralls/github/kubawerlos/php-cs-fixer-custom-fixers/master.svg)](https://coveralls.io/github/kubawerlos/php-cs-fixer-custom-fixers?branch=master)
1011
![Tests](https://img.shields.io/badge/tests-930-brightgreen.svg)
11-
[![Last commit](https://img.shields.io/github/last-commit/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/commits)
12+
[![Mutation testing badge](https://badge.stryker-mutator.io/github.com/kubawerlos/php-cs-fixer-custom-fixers/master)](https://stryker-mutator.github.io)
1213

1314
A set of custom fixers for [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).
1415

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"require-dev": {
2323
"ext-json": "*",
24+
"infection/infection": "^0.13.3",
2425
"johnkary/phpunit-speedtrap": "^3.1",
2526
"kubawerlos/types-checker": "^1.1",
2627
"phpunit/phpunit": "^7.4 || ^8.0",

infection.json.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"source": {
3+
"directories": [
4+
"src",
5+
"src-dev"
6+
]
7+
},
8+
"timeout": 10,
9+
"logs": {
10+
"text": "infection.log",
11+
"badge": {
12+
"branch": "master"
13+
}
14+
},
15+
"mutators": {
16+
"@default": true
17+
}
18+
}

src-dev/Readme/ReadmeCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ private function badges(): string
4545
$this->badge(
4646
'PHP version',
4747
\sprintf('%s/packagist/php-v/%s.svg', self::SHIELDS_HOST, $this->composer()->name),
48-
//\sprintf('%s/badge/php-%s-8892BF.svg', self::SHIELDS_HOST, \rawurlencode($this->composer()->require->php)),
4948
'https://php.net'
5049
),
5150
$this->badge(
@@ -57,6 +56,11 @@ private function badges(): string
5756
'Repository size',
5857
\sprintf('https://github-size-badge.herokuapp.com/%s.svg', $this->composer()->name)
5958
),
59+
$this->badge(
60+
'Last commit',
61+
\sprintf('%s/github/last-commit/%s.svg', self::SHIELDS_HOST, $this->composer()->name),
62+
\sprintf('https://github.com/%s/commits', $this->composer()->name)
63+
),
6064
'',
6165
$this->badge(
6266
'Build status',
@@ -73,9 +77,9 @@ private function badges(): string
7377
\sprintf('%s/badge/tests-%d-brightgreen.svg', self::SHIELDS_HOST, $this->numberOfTests())
7478
),
7579
$this->badge(
76-
'Last commit',
77-
\sprintf('%s/github/last-commit/%s.svg', self::SHIELDS_HOST, $this->composer()->name),
78-
\sprintf('https://github.com/%s/commits', $this->composer()->name)
80+
'Mutation testing badge',
81+
\sprintf('https://badge.stryker-mutator.io/github.com/%s/master', $this->composer()->name),
82+
'https://stryker-mutator.github.io'
7983
),
8084
]) . "\n";
8185
}

0 commit comments

Comments
 (0)