Skip to content

Commit

Permalink
Merge pull request #32 from Lullabot/phpstan-configurable
Browse files Browse the repository at this point in the history
Make PHPStan configurable per project
  • Loading branch information
justafish authored Jan 10, 2022
2 parents c476cd7 + 7133143 commit 96c57ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
includes:
- ../../../mglaman/phpstan-drupal/extension.neon
- ../../../phpstan/phpstan-deprecation-rules/rules.neon
- ../../../../phpstan.neon

parameters:
excludePaths:
Expand Down
1 change: 1 addition & 0 deletions scaffold/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parameters:
9 changes: 9 additions & 0 deletions src/DevScaffoldInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function onPostInstallCmd(Event $event)
$this->installDdevSeleniumConfig();
$this->installNightwatchConfig();
$this->installPhpCsConfig();
$this->installPhpStanConfig();
$this->printUserCommands();
}

Expand All @@ -103,6 +104,7 @@ public function onPostUpdateCmd(Event $event)
$this->installDdevSeleniumConfig();
$this->installNightwatchConfig();
$this->installPhpCsConfig();
$this->installPhpStanConfig();
$this->printUserCommands();
}

Expand Down Expand Up @@ -304,4 +306,11 @@ private function installPhpCsConfig(): void
$this->installScaffoldFile('phpcs.xml', 'phpcs.xml');
}
}

private function installPhpStanConfig(): void
{
if (!file_exists('./phpstan.neon')) {
$this->installScaffoldFile('phpstan.neon', 'phpstan.neon');
}
}
}

0 comments on commit 96c57ff

Please sign in to comment.