fix: link warning

This commit is contained in:
nunomaduro
2026-09-17 12:37:05 +01:00
parent 4b4474dd77
commit f0dd0d4d85
2 changed files with 12 additions and 4 deletions
+3 -3
View File
@@ -25,13 +25,13 @@
"pestphp/pest-plugin-arch": "^5.0.0",
"pestphp/pest-plugin-mutate": "^5.0.2",
"pestphp/pest-plugin-profanity": "^5.0.0",
"phpunit/phpunit": "^13.3.3",
"symfony/process": "^8.1.6"
"phpunit/phpunit": "^13.3.4",
"symfony/process": "^8.1.7"
},
"conflict": {
"filp/whoops": "<2.18.3",
"laravel/boost": "<2.6.0",
"phpunit/phpunit": ">13.3.3",
"phpunit/phpunit": ">13.3.4",
"sebastian/exporter": "<7.0.0",
"webmozart/assert": "<1.11.0"
},
+9 -1
View File
@@ -519,13 +519,21 @@ final class Project
throw new RuntimeException(sprintf('Unable to create [%s].', $directory));
}
if (@link($from, $to) || @copy($from, $to)) {
if ((self::shareDevice($from, $directory) && @link($from, $to)) || @copy($from, $to)) {
return;
}
throw new RuntimeException(sprintf('Unable to mirror [%s] into [%s].', $from, $to));
}
private static function shareDevice(string $from, string $directory): bool
{
$source = @stat($from);
$target = @stat($directory);
return $source !== false && $target !== false && $source['dev'] === $target['dev'];
}
/**
* @return iterable<\SplFileInfo>
*/