Skip to content

Commit

Permalink
fix: Pick the correct custom vendor-dir config (#1290)
Browse files Browse the repository at this point in the history
The tests will be covered by #1288.
  • Loading branch information
theofidry authored Dec 16, 2023
1 parent 23d6f5b commit 5504e12
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1217,11 +1217,10 @@ private static function retrieveAllDirectoriesToInclude(
): array {
$toString = static fn (SplFileInfo|string $file): string => (string) $file;

if (null !== $decodedJsonContents && array_key_exists('vendor-dir', $decodedJsonContents)) {
$vendorDir = self::normalizePath($decodedJsonContents['vendor-dir'], $basePath);
} else {
$vendorDir = self::normalizePath('vendor', $basePath);
}
$vendorDir = self::normalizePath(
$decodedJsonContents['config']['vendor-dir'] ?? 'vendor',
$basePath,
);

if (file_exists($vendorDir)) {
// Note that some files may not exist. For example installed.json does not exist at all if no dependencies
Expand Down

0 comments on commit 5504e12

Please sign in to comment.