-
Notifications
You must be signed in to change notification settings - Fork 50
Introduce Phpstan #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Phpstan #456
Changes from 14 commits
f3089c6
4839695
4586a3c
1937753
1e23c10
6d986f9
e73d20e
eb40e72
cfc3ae4
f9c3740
f0381b9
c76b1a3
89d3c7b
7492cbe
d850dac
5f03635
9e3be05
c1e4e35
3eeb7f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "Static analysis" | ||
|
||
on: | ||
push: | ||
branches: | ||
- '[0-9]+.x' | ||
- '[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.x' | ||
pull_request: | ||
|
||
jobs: | ||
phpstan: | ||
name: "PHPStan" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v3" | ||
- name: PHPStan | ||
uses: "docker://oskarstark/phpstan-ga" | ||
env: | ||
REQUIRE_DEV: true | ||
with: | ||
args: analyze --no-progress |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
/build/ | ||
/composer.lock | ||
/phpspec.yml | ||
/phpstan.neon | ||
/phpunit.xml | ||
/vendor/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Call to static method create\\(\\) on an unknown class Symfony\\\\Component\\\\HttpClient\\\\HttpClient\\.$#" | ||
count: 1 | ||
path: src/ClientFactory/SymfonyFactory.php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess this means we don't test the factory, otherwise we would depend on the symfony http client. we should probably add that, but in a separate merge request. and its no blocker for releasing 2.0 |
||
|
||
- | ||
message: "#^Class Http\\\\Client\\\\Plugin\\\\Vcr\\\\NamingStrategy\\\\NamingStrategyInterface not found\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does the code properly handle a missing vcr plugin? if it does its okay i guess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could some nice to haves would be to have the configuration class error when configuring without vcr without having the plugin installed, and https://github.com/php-http/HttplugBundle/blob/b7ad2c1951edec36ef0bd9897e309b0038c59a54/src/DependencyInjection/HttplugExtension.php should throw an exception at the beginning of the method if vcr is not available. but probably this still not enough to make phpstan happy, so composer require step for this could be added. that means that phpstan locally would complain about those though 🤔 we can also merge the current state and continue in separate pull requests. |
||
|
||
- | ||
message: "#^Class Http\\\\Client\\\\Plugin\\\\Vcr\\\\Recorder\\\\PlayerInterface not found\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
|
||
- | ||
message: "#^Class Http\\\\Client\\\\Plugin\\\\Vcr\\\\Recorder\\\\RecorderInterface not found\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
|
||
- | ||
message: "#^Class Http\\\\Client\\\\Plugin\\\\Vcr\\\\RecordPlugin not found\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/HttplugExtension.php | ||
|
||
- | ||
message: "#^Class Http\\\\Client\\\\Plugin\\\\Vcr\\\\ReplayPlugin not found\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/HttplugExtension.php |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
scanFiles: | ||
- vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php | ||
Prometee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
level: 1 | ||
paths: | ||
- src |
Uh oh!
There was an error while loading. Please reload this page.