Skip to content

Commit 83f83ec

Browse files
authored
Fix error fetching version with custom autoload (#2366)
1 parent 23392e4 commit 83f83ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Phinx/Console/PhinxApplication.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public function getVersion(): string
9494
}
9595

9696
// Otherwise fallback to the version as reported by composer
97-
return $this->version = InstalledVersions::getPrettyVersion('robmorgan/phinx') ?? 'UNKNOWN';
97+
if (class_exists(InstalledVersions::class)) {
98+
return $this->version = InstalledVersions::getPrettyVersion('robmorgan/phinx') ?? 'UNKNOWN';
99+
}
100+
101+
return $this->version = 'UNKNOWN';
98102
}
99103
}

0 commit comments

Comments
 (0)