Skip to content

Commit

Permalink
Merge pull request #570 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 committed Jun 26, 2023
2 parents bb464b5 + 34c46b4 commit d44be63
Show file tree
Hide file tree
Showing 51 changed files with 361 additions and 210 deletions.
1 change: 1 addition & 0 deletions .github/settings.yml
Expand Up @@ -82,6 +82,7 @@ repository:
has_pages: false
has_projects: false
has_wiki: false
is_template: false
name: "phpstan-rules"
private: false

Expand Down
55 changes: 44 additions & 11 deletions .github/workflows/integrate.yaml
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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/determine-cache-directory@1.8.0"

Expand Down Expand Up @@ -93,7 +96,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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 Expand Up @@ -121,7 +124,7 @@ jobs:
run: "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/cache@v3.3.1"
Expand Down Expand Up @@ -159,13 +162,16 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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/determine-cache-directory@1.8.0"

Expand Down Expand Up @@ -210,12 +216,15 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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/determine-cache-directory@1.8.0"

Expand Down Expand Up @@ -257,12 +266,15 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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/determine-cache-directory@1.8.0"

Expand All @@ -279,7 +291,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/cache@v3.3.1"
Expand Down Expand Up @@ -314,7 +326,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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 @@ -323,6 +335,21 @@ jobs:
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.8.0"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v3.3.1"
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/install@1.8.0"
with:
dependencies: "${{ matrix.dependencies }}"

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

Expand Down Expand Up @@ -353,6 +380,9 @@ jobs:
- 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/determine-cache-directory@1.8.0"

Expand All @@ -369,13 +399,13 @@ jobs:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1"

- 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 @@ -404,7 +434,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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 @@ -413,6 +443,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/determine-cache-directory@1.8.0"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: "shivammathur/setup-php@2.25.4"
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
@@ -1,5 +1,5 @@
/.build/
/.notes/
/.note/
/.phive/
/vendor/
!/.phive/phars.xml
5 changes: 2 additions & 3 deletions .php-cs-fixer.php
Expand Up @@ -32,12 +32,11 @@
->exclude([
'.build/',
'.github/',
'.notes/',
'.note/',
'test/Fixture/',
])
->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
Expand Up @@ -2,7 +2,7 @@ extends: "default"

ignore: |
.build/
.notes/
.note/
vendor/
rules:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -11,8 +11,8 @@ coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.
yamllint -c .yamllint.yaml --strict .
composer normalize
mkdir -p .build/php-cs-fixer/
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --verbose

.PHONY: dependency-analysis
dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/composer-require-checker
Expand Down
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,7 @@

[![Latest Stable Version](https://poser.pugx.org/ergebnis/phpstan-rules/v/stable)](https://packagist.org/packages/ergebnis/phpstan-rules)
[![Total Downloads](https://poser.pugx.org/ergebnis/phpstan-rules/downloads)](https://packagist.org/packages/ergebnis/phpstan-rules)
[![Monthly Downloads](http://poser.pugx.org/ergebnis/phpstan-rules/d/monthly)](https://packagist.org/packages/ergebnis/phpstan-rules)

Provides additional rules for [`phpstan/phpstan`](https://github.com/phpstan/phpstan).

Expand Down Expand Up @@ -531,6 +532,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
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -30,6 +30,7 @@
"ergebnis/composer-normalize": "^2.31.0",
"ergebnis/license": "^2.1.0",
"ergebnis/php-cs-fixer-config": "^5.6.0",
"ergebnis/phpunit-slow-test-detector": "^2.3.0",
"infection/infection": "~0.27.0",
"nette/di": "^3.1.2",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
Expand Down
70 changes: 69 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d44be63

Please sign in to comment.