Skip to content
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

Robust code #4740

Open
szepeviktor opened this issue Aug 10, 2019 · 1 comment

Comments

@szepeviktor
Copy link
Contributor

commented Aug 10, 2019

Hello!

Please consider using @phpstan
The PHAR file is here
On Level 0 it shows 5 issues, on Level max 3995
It is tricky to get started, described below in the NEON file.

phpstan.neon.dist

# mkdir config storage
# ln -s ../.. vendor/craftcms/cms
# phpstan analyse -l 0

includes:
    - phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
    level: max
    inferPrivatePropertyTypeFromConstructor: true
    paths:
        - %currentWorkingDirectory%/src/
    autoload_files:
        # <?php define('CRAFT_VENDOR_PATH', dirname(__DIR__, 2).'/vendor/');
        - %currentWorkingDirectory%/tests/static-analysis/bootstrap.php
        - %currentWorkingDirectory%/vendor/twig/twig/src/Extension/CoreExtension.php
        - %currentWorkingDirectory%/bootstrap/console.php
#        - %currentWorkingDirectory%/bootstrap/web.php
    excludes_analyse:
        - %currentWorkingDirectory%/src/test/
        - %currentWorkingDirectory%/src/views/
@angrybrad

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

Will look into possibly adding this to our travis build config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.