diff --git a/src/Phinx/Console/PhinxApplication.php b/src/Phinx/Console/PhinxApplication.php index 666eb54ea..ca71911bb 100644 --- a/src/Phinx/Console/PhinxApplication.php +++ b/src/Phinx/Console/PhinxApplication.php @@ -94,6 +94,10 @@ public function getVersion(): string } // Otherwise fallback to the version as reported by composer - return $this->version = InstalledVersions::getPrettyVersion('robmorgan/phinx') ?? 'UNKNOWN'; + if (class_exists(InstalledVersions::class)) { + return $this->version = InstalledVersions::getPrettyVersion('robmorgan/phinx') ?? 'UNKNOWN'; + } + + return $this->version = 'UNKNOWN'; } }