Skip to content

Commit 05aeaca

Browse files
authored
Merge pull request #101 from wunderio/hotfix/99-fix-php_stan-error-with-DrupalAutoloader
#99 Fix PHP Stan error with DrupalAutoloader.
2 parents 9c84619 + c7a9908 commit 05aeaca

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"dealerdirect/phpcodesniffer-composer-installer": "*",
4545
"mglaman/phpstan-drupal": "^1.1",
4646
"phpstan/extension-installer": "^1.1",
47-
"phpstan/phpstan-deprecation-rules": "^1.0"
47+
"phpstan/phpstan-deprecation-rules": "^1.0",
48+
"webflo/drupal-finder": "^1.3"
4849
},
4950
"autoload": {
5051
"psr-4": {

src/Drupal/DrupalAutoloader.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Wunderio\GrumPHP\Drupal;
66

77
use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
8-
use DrupalFinder\DrupalFinder;
8+
use DrupalFinder\DrupalFinderComposerRuntime;
99
use Drush\Drush;
1010
use mglaman\PHPStanDrupal\Drupal\Extension;
1111
use mglaman\PHPStanDrupal\Drupal\ExtensionDiscovery;
@@ -90,8 +90,7 @@ class DrupalAutoloader {
9090
* Path to Drupal root.
9191
*/
9292
public function register(string $drupalRoot): void {
93-
$finder = new DrupalFinder();
94-
$finder->locateRoot($drupalRoot);
93+
$finder = new DrupalFinderComposerRuntime();
9594

9695
$drupalRoot = $finder->getDrupalRoot();
9796
$drupalVendorRoot = $finder->getVendorDir();

src/Task/Psalm/services.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
Wunderio\GrumPHP\Task\Psalm\PsalmTask:
3+
class: Wunderio\GrumPHP\Task\Psalm\PsalmTask
4+
arguments:
5+
- '@process_builder'
6+
- '@formatter.raw_process'
7+
tags:
8+
- {name: grumphp.task, task: psalm}

0 commit comments

Comments
 (0)