Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Phpstan support #279

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

Closed
panosru wants to merge 2 commits into php-censor:master from panosru:phpstan-support
Closed

Phpstan support #279

panosru wants to merge 2 commits into php-censor:master from panosru:phpstan-support

Conversation

Copy link
Contributor

@panosru panosru commented Feb 17, 2019

Runs PhpStan against your build.

PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

PHPStan requires PHP >= 7.1. You have to run it in environment with PHP 7.x but the actual code does not have to use
PHP 7.x features. (Code written for PHP 5.6 and earlier can run on 7.x mostly unmodified.)

test:
 phpstan: ~

image
image

test:
 phpstan:
 allowed_errors: -1

image

PhpStan also have plugins, the plugins I used for my current test was:

More plugins can be found here

My phpstan.neon file for the project was:

includes:
 - /root/.composer/vendor/phpstan/phpstan-phpunit/extension.neon
 - /root/.composer/vendor/phpstan/phpstan-phpunit/rules.neon
 - /root/.composer/vendor/phpstan/phpstan-strict-rules/rules.neon
 - /root/.composer/vendor/phpstan/phpstan-deprecation-rules/rules.neon
 - /root/.composer/vendor/phpstan/phpstan-php-parser/extension.neon
 - /root/.composer/vendor/phpstan/phpstan-mockery/extension.neon
 - /root/.composer/vendor/phpstan/phpstan-beberlei-assert/extension.neon
parameters:
 level: max
 paths:
 - src
 - tests

Example of phpstan.neon file

corpsee reacted with thumbs up emoji
@corpsee corpsee self-requested a review February 17, 2019 04:57
@corpsee corpsee added this to the Version 1.x.0 (minor) milestone Feb 17, 2019
Copy link
Member

corpsee commented Feb 17, 2019

@panosru Thanks!

Copy link
Member

corpsee commented Feb 18, 2019

Merged to master manually and will be released with PHP Censor version 1.1.0.

@corpsee corpsee modified the milestones: Version 1.1.0 (minor), 1.1.0 May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@corpsee corpsee Awaiting requested review from corpsee

Assignees
No one assigned
Projects
None yet
Milestone
1.1.0
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /