Skip to content

Commit 988e3fa

Browse files
committed
- look for a file, exclude a directory
1 parent 38b5693 commit 988e3fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

semver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ function get_complete_version(array $version): array
6464
if (empty($version)) {
6565
$version = match (true) {
6666
defined('VERSION') && is_array(VERSION) => get_version_array(join('-', array_filter(VERSION))),
67-
file_exists($version = __DIR__ . '/../../../VERSION'), // project dir relative to /vendor
68-
file_exists($version = getcwd() . '/VERSION') => get_version_array(@file_get_contents($version)),
67+
is_file($version = __DIR__ . '/../../../VERSION'), // project dir relative to /vendor
68+
is_file($version = getcwd() . '/VERSION') => get_version_array(@file_get_contents($version)),
6969
default => INVALID_VERSION_ARRAY,
7070
};
7171
}

0 commit comments

Comments
 (0)