Skip to content

Commit 7f74443

Browse files
committed
#99 Fix PHP Stan error with DrupalAutoloader (repeating fix in another branch for easier merge)
1 parent cd89292 commit 7f74443

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"vimeo/psalm": "^4",
4949
"nette/finder": "^2.5",
5050
"symfony/finder": "^4.4 || ^5.3 || ^6",
51-
"tomasvotruba/cognitive-complexity": "^0.1.1"
51+
"tomasvotruba/cognitive-complexity": "^0.1.1",
52+
"webflo/drupal-finder": "^1.3"
5253
},
5354
"autoload": {
5455
"psr-4": {

src/Drupal/DrupalAutoloader.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Wunderio\GrumPHP\Drupal;
66

7-
use DrupalFinder\DrupalFinder;
7+
use DrupalFinder\DrupalFinderComposerRuntime;
88
use Drush\Drush;
99
use Nette\Utils\Finder;
1010
use PHPUnit\Framework\Test;
@@ -26,8 +26,7 @@ class DrupalAutoloader extends DrupalAutoloaderBase {
2626
* Path to Drupal root.
2727
*/
2828
public function register(string $drupalRoot): void {
29-
$finder = new DrupalFinder();
30-
$finder->locateRoot($drupalRoot);
29+
$finder = new DrupalFinderComposerRuntime();
3130

3231
$drupalRoot = $finder->getDrupalRoot();
3332
$drupalVendorRoot = $finder->getVendorDir();

0 commit comments

Comments
 (0)