mirror of
https://github.com/cerbero90/json-parser.git
synced 2025-01-16 20:48:15 +01:00
Install and configure PHPStan
This commit is contained in:
parent
20a20ca2dd
commit
5d30eac49e
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: [8.0, 8.1, 8.2]
|
||||
dependency-version: [prefer-stable]
|
||||
dependency-version: [prefer-lowest, prefer-stable]
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
|
||||
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
|
||||
@ -81,3 +81,22 @@ jobs:
|
||||
|
||||
- name: Execute check
|
||||
run: phpcs --standard=psr12 src/
|
||||
|
||||
static:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: Coding style
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.0
|
||||
tools: phpstan
|
||||
coverage: none
|
||||
|
||||
- name: Execute check
|
||||
run: phpstan analyse
|
||||
|
@ -5,6 +5,7 @@
|
||||
[![Build Status][ico-actions]][link-actions]
|
||||
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
|
||||
[![Quality Score][ico-code-quality]][link-code-quality]
|
||||
[![PHPStan Level][ico-phpstan]][link-phpstan]
|
||||
[![Latest Version][ico-version]][link-packagist]
|
||||
[![Software License][ico-license]](LICENSE.md)
|
||||
[![PSR-12][ico-psr12]][link-psr12]
|
||||
@ -60,6 +61,7 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
|
||||
[ico-psr12]: https://img.shields.io/static/v1?label=compliance&message=PSR-12&color=blue&style=flat-square
|
||||
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/cerbero90/json-parser.svg?style=flat-square&logo=scrutinizer
|
||||
[ico-code-quality]: https://img.shields.io/scrutinizer/g/cerbero90/json-parser.svg?style=flat-square&logo=scrutinizer
|
||||
[ico-phpstan]: https://img.shields.io/badge/level-max-success?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGb0lEQVR42u1Xe1BUZRS/y4Kg8oiR3FCCBUySESZBRCiaBnmEsOzeSzsg+KxYYO9dEEftNRqZjx40FRZkTpqmOz5S2LsXlEZBciatkQnHDGYaGdFy1EpGMHl/p/PdFlt2rk5O+J9n5nA/vtf5ned3lnlISpRhafBlLRLHCtJGVrB/ZBDsaw2lUqzReGAC46DstTYfnSCGUjaaDvgxACo6j3vUenNdImeRXqdnWV5az5rrnzeZznj8J+E5Ftsclhf3s4J4CS/oRx5Bvon8ZU65FGYQxAwcf85a7CeRz+C41THejueydCZ7AAK34nwv3kHP/oUKdOL4K7258fF7Cud427O48RQeGkIGJ77N8fZqlrcfRP4d/x90WQfHXLeBt9dTrSlwl3V65ynWLM1SEA2qbNQckbe4Xmww10Hmy3shid0CMcmlEJtSDsl5VZBdfAgMvI3uuR+moJqN6LaxmpsOBeLCDmTifCB92RcQmbAUJvtqALc5sQr8p86gYBCcFdBq9wOin7NQax6ewlB6rqLZHf23FP10y3lj6uJtEBg2HxiVCtzd3SEwMBCio6Nh9uzZ4O/vLwOZ4OUNM2NyIGPFrvuzBG//lRPs+VQ2k1ki+ePkd84bskz7YFpYgizEz88P8vPzYffu3dDS0gJNTU1QXV0NqampRK1WIwgfiE4qhOyig0rC+pCvK8QUoML7uJVHA5kcQUp3DSpqWjc3d/Dy8oKioiLo6uqCoaEhuHb1KvT09AAhBFpbW4lOpyMyyIBQSCmoUQLQzgniNvz+obB2HS2RwBgE6dOxCyJogmNkP2u1Wrhw4QJ03+iGrR9XEd3CTNBn6eCbo40wPDwMdXV1BF1DVG5qiEtboxSUP6J71+D3NwUAhLOIRQzm7lnnhYUv7QFv/yDZ/Lm5ubK2DVI9iZ8bR8JDtEB57lNzENQN6OjoIGlp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mnEgdHhKyNSZe16crtBIlc7sIb6cRLft2PCgoKGjijBDtjrAQ7a3EdMsxzIRflAFIhPb6mHYmYwX+WBlPQgskhgVryyJCQyNyBLsBQdQ6fgsQhyt6MSOOsWZ7gbH8wETmgRKAijatNL8Ngm0xx4tLcsps0Wzx4al0jXlI40B/A3pa144MDtSgAAAAAElFTkSuQmCC
|
||||
[ico-downloads]: https://img.shields.io/packagist/dt/cerbero/json-parser.svg?style=flat-square
|
||||
|
||||
[link-author]: https://twitter.com/cerbero90
|
||||
@ -69,5 +71,6 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
|
||||
[link-psr12]: https://www.php-fig.org/psr/psr-12/
|
||||
[link-scrutinizer]: https://scrutinizer-ci.com/g/cerbero90/json-parser/code-structure
|
||||
[link-code-quality]: https://scrutinizer-ci.com/g/cerbero90/json-parser
|
||||
[link-phpstan]: https://phpstan.org/
|
||||
[link-downloads]: https://packagist.org/packages/cerbero/json-parser
|
||||
[link-contributors]: ../../contributors
|
||||
|
@ -24,6 +24,7 @@
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"illuminate/http": ">=6.20",
|
||||
"pestphp/pest": "^1.21",
|
||||
"phpstan/phpstan": "^1.9",
|
||||
"scrutinizer/ocular": "^1.8",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
|
16
phpstan-baseline.neon
Normal file
16
phpstan-baseline.neon
Normal file
@ -0,0 +1,16 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Generator expects key type int\\|string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Parser.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$json of method Cerbero\\\\JsonParser\\\\Decoders\\\\ConfigurableDecoder\\:\\:decode\\(\\) expects string, int\\|string given\\.$#"
|
||||
count: 1
|
||||
path: src/Parser.php
|
||||
|
||||
-
|
||||
message: "#^Binary operation \"\\+\" between int\\|string and 1 results in an error\\.$#"
|
||||
count: 1
|
||||
path: src/Tree.php
|
6
phpstan.neon
Normal file
6
phpstan.neon
Normal file
@ -0,0 +1,6 @@
|
||||
parameters:
|
||||
level: max
|
||||
paths:
|
||||
- src
|
||||
includes:
|
||||
- phpstan-baseline.neon
|
Loading…
x
Reference in New Issue
Block a user