Skip to content

Commit ebf8766

Browse files
authored
Merge pull request #848 from ergebnis/feature/synchronize
Enhancement: Synchronize with `ergebnis/php-package-template`
2 parents fb98420 + 03d4693 commit ebf8766

13 files changed

Lines changed: 67 additions & 61 deletions

.github/CONTRIBUTING.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ For details, take a look at the following workflow configuration files:
66

77
- [`workflows/integrate.yaml`](workflows/integrate.yaml)
88
- [`workflows/merge.yaml`](workflows/merge.yaml)
9-
- [`workflows/prune.yaml`](workflows/prune.yaml)
109
- [`workflows/release.yaml`](workflows/release.yaml)
1110
- [`workflows/renew.yaml`](workflows/renew.yaml)
1211
- [`workflows/triage.yaml`](workflows/triage.yaml)
@@ -48,6 +47,18 @@ make dependency-analysis
4847

4948
to run a dependency analysis.
5049

50+
## Mutation Tests
51+
52+
We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.
53+
54+
Enable `Xdebug` and run
55+
56+
```sh
57+
make mutation-tests
58+
```
59+
60+
to run mutation tests.
61+
5162
## Refactoring
5263

5364
We are using [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code.
@@ -84,17 +95,17 @@ make static-code-analysis
8495

8596
to run a static code analysis.
8697

87-
We are also using the baseline features of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
98+
We are also using the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
8899

89100
Run
90101

91102
```sh
92103
make static-code-analysis-baseline
93104
```
94105

95-
to regenerate the baseline [`../psalm-baseline.xml`](../psalm-baseline.xml).
106+
to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).
96107

97-
:exclamation: Ideally, the baselines should shrink over time.
108+
:exclamation: Ideally, the baseline should shrink over time.
98109

99110
## Tests
100111

@@ -108,18 +119,6 @@ make tests
108119

109120
to run all the tests.
110121

111-
## Mutation Tests
112-
113-
We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.
114-
115-
Enable `Xdebug` and run
116-
117-
```sh
118-
make mutation-tests
119-
```
120-
121-
to run mutation tests.
122-
123122
## Extra lazy?
124123

125124
Run

.github/settings.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ labels:
6767
color: "ee0701"
6868
description: ""
6969

70-
- name: "stale"
71-
color: "eeeeee"
72-
description: ""
73-
7470
# https://docs.github.com/en/rest/reference/repos#update-a-repository
7571

7672
repository:

.github/workflows/integrate.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
coverage: "none"
9696
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
9797
php-version: "${{ matrix.php-version }}"
98+
tools: "phive"
9899

99100
- name: "Set up problem matchers for PHP"
100101
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
@@ -117,6 +118,11 @@ jobs:
117118
with:
118119
dependencies: "${{ matrix.dependencies }}"
119120

121+
- name: "Install dependencies with phive"
122+
uses: "ergebnis/.github/actions/phive/install@1.8.0"
123+
with:
124+
trust-gpg-keys: "0xC00543248C87FB13,0x033E5F8D801A2F8D"
125+
120126
- name: "Run ergebnis/composer-normalize"
121127
run: ".phive/composer-normalize --ansi --dry-run"
122128

@@ -158,6 +164,7 @@ jobs:
158164
coverage: "none"
159165
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
160166
php-version: "${{ matrix.php-version }}"
167+
tools: "phive"
161168

162169
- name: "Set up problem matchers for PHP"
163170
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
@@ -177,6 +184,11 @@ jobs:
177184
with:
178185
dependencies: "${{ matrix.dependencies }}"
179186

187+
- name: "Install dependencies with phive"
188+
uses: "ergebnis/.github/actions/phive/install@1.8.0"
189+
with:
190+
trust-gpg-keys: "0xC00543248C87FB13,0x033E5F8D801A2F8D"
191+
180192
- name: "Run maglnet/composer-require-checker"
181193
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"
182194

.github/workflows/prune.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/.build/
22
/.notes/
3+
/.phive/
34
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Conflict/
45
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Provide/
56
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Replace/
67
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Require/
78
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/RequireDev/
89
/vendor/
10+
!/.phive/phars.xml

.phive/composer-normalize

-928 KB
Binary file not shown.

.phive/composer-require-checker

-640 KB
Binary file not shown.

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-normalize" version="^2.24.1" installed="2.24.1" location="./.phive/composer-normalize" copy="true"/>
4-
<phar name="composer-require-checker" version="^4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="true"/>
3+
<phar name="composer-normalize" version="^2.24.1" installed="2.24.1" location="./.phive/composer-normalize" copy="false"/>
4+
<phar name="composer-require-checker" version="^4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="false"/>
55
</phive>

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ code-coverage: vendor ## Collects coverage from running unit tests with phpunit/
77
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text
88

99
.PHONY: coding-standards
10-
coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
10+
coding-standards: phive vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
1111
yamllint -c .yamllint.yaml --strict .
1212
.phive/composer-normalize
1313
mkdir -p .build/php-cs-fixer
1414
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --verbose
1515

1616
.PHONY: dependency-analysis
17-
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
17+
dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/composer-require-checker
1818
.phive/composer-require-checker check --config-file=$(shell pwd)/composer-require-checker.json
1919

2020
.PHONY: help
@@ -26,6 +26,11 @@ mutation-tests: vendor ## Runs mutation tests with infection/infection
2626
mkdir -p .build/infection
2727
vendor/bin/infection --configuration=infection.json
2828

29+
.PHONY: phive
30+
phive: .phive ## Installs dependencies with phive
31+
mkdir -p .build/phive
32+
PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0xC00543248C87FB13,0x033E5F8D801A2F8D
33+
2934
.PHONY: refactoring
3035
refactoring: vendor ## Runs automated refactoring with rector/rector
3136
vendor/bin/rector process --config=rector.php

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![Integrate](https://github.com/ergebnis/json-normalizer/workflows/Integrate/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
44
[![Merge](https://github.com/ergebnis/json-normalizer/workflows/Merge/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
5-
[![Prune](https://github.com/ergebnis/json-normalizer/workflows/Prune/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
65
[![Release](https://github.com/ergebnis/json-normalizer/workflows/Release/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
76
[![Renew](https://github.com/ergebnis/json-normalizer/workflows/Renew/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
87
[![Triage](https://github.com/ergebnis/json-normalizer/workflows/Triage/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
@@ -13,6 +12,7 @@
1312

1413
[![Latest Stable Version](https://poser.pugx.org/ergebnis/json-normalizer/v/stable)](https://packagist.org/packages/ergebnis/json-normalizer)
1514
[![Total Downloads](https://poser.pugx.org/ergebnis/json-normalizer/downloads)](https://packagist.org/packages/ergebnis/json-normalizer)
15+
[![Monthly Downloads](http://poser.pugx.org/ergebnis/json-normalizer/d/monthly)](https://packagist.org/packages/ergebnis/json-normalizer)
1616

1717
Provides generic and vendor-specific normalizers for normalizing JSON documents.
1818

@@ -496,4 +496,4 @@ The algorithm for sorting packages in the [`Vendor\Composer\PackageHashNormalize
496496

497497
## Curious what I am up to?
498498

499-
Follow me on [Twitter](https://twitter.com/localheinz)!
499+
Follow me on [Twitter](https://twitter.com/intent/follow?screen_name=localheinz)!

0 commit comments

Comments
 (0)