Skip to content

Commit

Permalink
Merge pull request #710 from ergebnis/feature/synchronize
Browse files Browse the repository at this point in the history
Enhancement: Synchronize with `ergebnis/php-package-template`
  • Loading branch information
localheinz authored Nov 28, 2023
2 parents 9cf300e + ae466e6 commit 8baf921
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 27 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
Expand Down
22 changes: 11 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CONTRIBUTING

We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.
We use [GitHub Actions](https://github.com/features/actions) as a continuous integration system.

For details, take a look at the following workflow configuration files:

Expand All @@ -12,9 +12,9 @@ For details, take a look at the following workflow configuration files:

## Coding Standards

We are using [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.
We use [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.

We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files.
We use [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files.

If you do not have `yamllint` installed yet, run

Expand All @@ -24,7 +24,7 @@ brew install yamllint

to install `yamllint`.

We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files.
We use [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files.

Run

Expand All @@ -36,7 +36,7 @@ to automatically fix coding standard violations.

## Dependency Analysis

We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/ComposerRequireChecker) to prevent the use of unknown symbols in production code.
We use [`maglnet/composer-require-checker`](https://github.com/maglnet/ComposerRequireChecker) to prevent the use of unknown symbols in production code.

Run

Expand All @@ -48,7 +48,7 @@ to run a dependency analysis.

## Mutation Tests

We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.
We use [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.

Enable `Xdebug` and run

Expand All @@ -60,7 +60,7 @@ to run mutation tests.

## Refactoring

We are using [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code.
We use [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code.

Run

Expand All @@ -72,7 +72,7 @@ to automatically refactor code.

## Security Analysis

We are using [`composer`](https://github.com/composer/composer) to run a security analysis.
We use [`composer`](https://github.com/composer/composer) to run a security analysis.

Run

Expand All @@ -84,7 +84,7 @@ to run a security analysis.

## Static Code Analysis

We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
We use [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.

Run

Expand All @@ -94,7 +94,7 @@ make static-code-analysis

to run a static code analysis.

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

Run

Expand All @@ -108,7 +108,7 @@ to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).

## Tests

We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.
We use [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.

Run

Expand Down
4 changes: 3 additions & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
version: 2

updates:
- commit-message:
- allow:
- dependency-type: "development"
commit-message:
include: "scope"
prefix: "composer"
directory: "/"
Expand Down
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://github.com/probot/settings
# https://github.com/repository-settings/app

branches:
- name: "main"
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -73,6 +75,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -149,6 +153,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -196,13 +202,15 @@ jobs:
trust-gpg-keys: "0xC00543248C87FB13,0x033E5F8D801A2F8D"

- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"
run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose"

mutation-tests:
name: "Mutation Tests"

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -253,6 +261,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -313,6 +323,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -361,6 +373,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down Expand Up @@ -412,6 +426,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

steps:
- name: "Create release"
uses: "ergebnis/.github/actions/github/release/create@1.8.0"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

strategy:
matrix:
php-version:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

runs-on: "ubuntu-latest"

timeout-minutes: 5

steps:
- name: "Add labels based on branch name"
uses: "ergebnis/.github/actions/github/pull-request/add-label-based-on-branch-name@1.8.0"
Expand Down
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-normalize" version="^2.32.0" installed="2.32.0" location="./.phive/composer-normalize" copy="false"/>
<phar name="composer-require-checker" version="^4.6.0" installed="4.6.0" location="./.phive/composer-require-checker" copy="false"/>
<phar name="composer-normalize" version="^2.32.0" installed="2.32.0" location="./.phive/composer-normalize" copy="false"/>
<phar name="composer-require-checker" version="^4.7.1" installed="4.7.1" location="./.phive/composer-require-checker" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ coding-standards: phive vendor ## Lints YAML files with yamllint, normalizes com

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

.PHONY: help
help: ## Displays this list of targets with descriptions
Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,42 @@ which results in `$printed`:

## Changelog

Please have a look at [`CHANGELOG.md`](CHANGELOG.md).
The maintainers of this package record notable changes to this project in a [changelog](CHANGELOG.md).

## Contributing

Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).
The maintainers of this package suggest following the [contribution guide](.github/CONTRIBUTING.md).

## Code of Conduct

Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).
The maintainers of this package ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).

## General Support Policy

The maintainers of this package provide limited support.

You can support the maintenance of this package by [sponsoring @localheinz](https://github.com/sponsors/localheinz) or [requesting an invoice for services related to this package](mailto:am@localheinz.com?subject=ergebnis/json-printer:%20Requesting%20invoice%20for%20services).

## PHP Version Support Policy

This package supports PHP versions with [active support](https://www.php.net/supported-versions.php).

The maintainers of this package add support for a PHP version following its initial release and drop support for a PHP version when it has reached its end of active support.

## Security Policy

Please have a look at [`SECURITY.md`](.github/SECURITY.md).
This package has a [security policy](.github/SECURITY.md).

## License

This package is licensed using the MIT License.

Please have a look at [`LICENSE.md`](LICENSE.md).
This package uses the [MIT license](LICENSE.md).

## Credits

The [`Printer`](src/Printer.php) is adopted from [`Composer\Json\JsonFormatter`](https://github.com/composer/composer/blob/1.6.0/src/Composer/Json/JsonFormatter.php) (originally licensed under MIT by [Nils Adermann](https://github.com/naderman) and [Jordi Boggiano](https://github.com/seldaek)), who adopted it from a [blog post by Dave Perrett](https://www.daveperrett.com/articles/2008/03/11/format-json-with-php/) (originally licensed under MIT by [Dave Perrett](https://github.com/recurser)).

The [`PrinterTest`](test/Unit/PrinterTest.php) is inspired by [`Composer\Test\Json\JsonFormatterTest`](https://github.com/composer/composer/blob/1.6.0/tests/Composer/Test/Json/JsonFormatterTest.php) (originally licensed under MIT by [Nils Adermann](https://github.com/naderman) and [Jordi Boggiano](https://github.com/seldaek)), as well as [`ZendTest\Json\JsonTest`](https://github.com/zendframework/zend-json/blob/release-3.0.0/test/JsonTest.php) (originally licensed under New BSD License).

## Curious what I am up to?
## Social

Follow me on [Twitter](https://twitter.com/intent/follow?screen_name=localheinz)!
Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.
2 changes: 1 addition & 1 deletion test/Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Helper
final protected static function faker(string $locale = 'en_US'): Generator
{
/**
* @var array<string, Generator>
* @var array<string, Generator> $fakers
*/
static $fakers = [];

Expand Down

0 comments on commit 8baf921

Please sign in to comment.