From acdd42ab954f424f0c8a44ff5c0d9d0458a6ad7d Mon Sep 17 00:00:00 2001 From: 0zd0 <67220210+0zd0@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:54:21 +0300 Subject: [PATCH] Fix errors with custom autoload --- src/Phinx/Console/PhinxApplication.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'; } }