Skip to content

Commit

Permalink
Enhancement: Synchronize with ergebnis/php-package-template
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jun 28, 2023
1 parent a50e9f4 commit 04bdc84
Show file tree
Hide file tree
Showing 59 changed files with 344 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-size
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @ergebnis-bot @localheinz
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Run
make
```

to enforce coding standards, run a static code analysis, and run tests!
to automatically refactor code, enforce coding standards, run a static code analysis, and run tests!

## Help

Expand Down
17 changes: 17 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

## Supported Versions

The following versions of `ergebnis/json-normalizer` have active support:

- `^4.1.0`

## Unsupported Versions

The following versions of `ergebnis/json-normalizer` have reached their end of life:

- `<4.1.0`

## Reporting a Vulnerability

If you believe that you have found a security vulnerability, please send an email to `[email protected]`. Ensure to include all details required to understand the severity of the issue.
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ repository:
description: ":page_with_curl: Provides generic and vendor-specific normalizers for normalizing JSON documents."
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
has_discussions: false
has_downloads: true
has_issues: true
has_pages: false
has_projects: false
has_wiki: false
is_template: false
name: "json-normalizer"
private: false

Expand Down
55 changes: 44 additions & 11 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand All @@ -39,6 +39,9 @@ jobs:
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand Down Expand Up @@ -93,7 +96,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
tools: "phive"

Expand Down Expand Up @@ -127,7 +130,7 @@ jobs:
run: ".phive/composer-normalize --ansi --dry-run"

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer/"

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/[email protected]"
Expand Down Expand Up @@ -162,13 +165,16 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"
tools: "phive"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand Down Expand Up @@ -213,12 +219,15 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand Down Expand Up @@ -260,12 +269,15 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand All @@ -282,7 +294,7 @@ jobs:
dependencies: "${{ matrix.dependencies }}"

- name: "Create cache directory for rector/rector"
run: "mkdir -p .build/rector"
run: "mkdir -p .build/rector/"

- name: "Cache cache directory for rector/rector"
uses: "actions/[email protected]"
Expand Down Expand Up @@ -317,7 +329,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand All @@ -326,6 +338,21 @@ jobs:
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/[email protected]"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Check installed packages for security vulnerability advisories"
run: "composer audit --ansi"

Expand All @@ -350,12 +377,15 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, curl, dom, json, mbstring, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand All @@ -372,7 +402,7 @@ jobs:
dependencies: "${{ matrix.dependencies }}"

- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"
run: "mkdir -p .build/psalm/"

- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
Expand Down Expand Up @@ -401,7 +431,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand All @@ -410,6 +440,9 @@ jobs:
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.build/
/.notes/
/.note/
/.phive/
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Conflict/
/test/Fixture/Vendor/Composer/ComposerJsonNormalizer/NormalizeNormalizesJson/Json/IsObject/HasEntries/Yes/HasProperty/Provide/
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.30.1" installed="2.30.1" location="./.phive/composer-normalize" copy="false"/>
<phar name="composer-require-checker" version="^4.4.0" installed="4.4.0" location="./.phive/composer-require-checker" copy="false"/>
<phar name="composer-normalize" version="^2.31.0" installed="2.31.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"/>
</phive>
5 changes: 2 additions & 3 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
->exclude([
'.build/',
'.github/',
'.notes/',
'.note/',
])
->ignoreDotFiles(false)
->in(__DIR__)
->name('.php-cs-fixer.php');
->in(__DIR__);

$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');

Expand Down
2 changes: 1 addition & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends: "default"

ignore: |
.build/
.notes/
.note/
vendor/
rules:
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ it: refactoring coding-standards security-analysis static-code-analysis tests ##

.PHONY: code-coverage
code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit
mkdir -p .build/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text

.PHONY: coding-standards
Expand All @@ -23,16 +23,17 @@ help: ## Displays this list of targets with descriptions

.PHONY: mutation-tests
mutation-tests: vendor ## Runs mutation tests with infection/infection
mkdir -p .build/infection
mkdir -p .build/infection/
vendor/bin/infection --configuration=infection.json

.PHONY: phive
phive: .phive ## Installs dependencies with phive
mkdir -p .build/phive
mkdir -p .build/phive/
PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0xC00543248C87FB13,0x033E5F8D801A2F8D

.PHONY: refactoring
refactoring: vendor ## Runs automated refactoring with rector/rector
mkdir -p .build/rector/
vendor/bin/rector process --config=rector.php

.PHONY: schema
Expand All @@ -46,19 +47,19 @@ security-analysis: vendor ## Runs a security analysis with composer

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
mkdir -p .build/psalm
mkdir -p .build/psalm/
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --show-info=false --stats --threads=4

.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
mkdir -p .build/psalm
mkdir -p .build/psalm/
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml

.PHONY: tests
tests: vendor ## Runs unit tests with phpunit/phpunit
mkdir -p .build/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml

vendor: composer.json composer.lock
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[![Merge](https://github.com/ergebnis/json-normalizer/workflows/Merge/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
[![Release](https://github.com/ergebnis/json-normalizer/workflows/Release/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
[![Renew](https://github.com/ergebnis/json-normalizer/workflows/Renew/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
[![Triage](https://github.com/ergebnis/json-normalizer/workflows/Triage/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)
[![Update](https://github.com/ergebnis/json-normalizer/workflows/Update/badge.svg)](https://github.com/ergebnis/json-normalizer/actions)

[![Code Coverage](https://codecov.io/gh/ergebnis/json-normalizer/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/json-normalizer)
Expand Down Expand Up @@ -582,6 +581,10 @@ Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).

Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).

## Security Policy

Please have a look at [`SECURITY.md`](.github/SECURITY.md).

## License

This package is licensed using the MIT License.
Expand Down
15 changes: 0 additions & 15 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"symbol-whitelist": [
"array",
"bool",
"callable",
"false",
"float",
"int",
"iterable",
"null",
"object",
"parent",
"self",
"static",
"string",
"true",
"void",
"Composer\\Semver\\Semver",
"Composer\\Semver\\VersionParser"
]
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"ergebnis/data-provider": "^2.0.0",
"ergebnis/license": "^2.1.0",
"ergebnis/php-cs-fixer-config": "^5.9.2",
"ergebnis/phpunit-slow-test-detector": "^2.3.0",
"fakerphp/faker": "^1.23.0",
"infection/infection": "~0.27.0",
"phpunit/phpunit": "^10.2.2",
Expand Down
Loading

0 comments on commit 04bdc84

Please sign in to comment.