What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

PHPStorm always complains that `phpstan: no rules detected...` is there some special config that nee

U03T08LE3CP
U03T08LE3CP Posts: 185 πŸ§‘πŸ»β€πŸš€ - Cadet

PHPStorm always complains that phpstan: no rules detected... is there some special config that needs to be made?

Comments

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    yep... this also drove me crazy
    in the phpstan.neon in your project root

    you need to add config for paths and level, e.g.

    parameters:
        paths:
            - src
            - tests/PyzTest
    
        level: max
    
  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    level: 4 is propably most used

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 πŸ§‘πŸ»β€πŸš€ - Cadet

    will this be compliant with cli execution?

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 πŸ§‘πŸ»β€πŸš€ - Cadet

    but this does indeed work, thanks!

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    vendor/spryker/development/src/Spryker/Zed/Development/Business/Phpstan/PhpstanRunner.php

    ...   
     protected function runCommand(
            string $path,
            string $configFilePath,
            InputInterface $input,
            OutputInterface $output
        ): int {
            $command = 'php -d memory_limit=%s vendor/bin/phpstan analyze --memory-limit=%s --no-progress -c %s %s -l %s';
    
    ...
    
  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    I guess as Spryker always gives path and level, it will overwrite what's put in the neon file πŸ€”

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 πŸ§‘πŸ»β€πŸš€ - Cadet

    yeah so it should be no harm then