Skip to content

Commit 1ea8daf

Browse files
replace DiClasses with Resolver
1 parent 4f81547 commit 1ea8daf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Database/Migration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace Effectra\Core\Database;
66

77
use Effectra\Core\Application;
8-
use Effectra\Core\Container\DiClasses;
98
use Effectra\Core\Facades\DB;
109
use Effectra\Fs\Directory;
1110
use Effectra\Fs\File;
1211
use Effectra\Fs\Path;
12+
use Effectra\Router\Resolver;
1313
use Effectra\SqlQuery\Query;
1414
use Effectra\SqlQuery\Table;
1515
use Symfony\Component\VarDumper\VarDumper;
@@ -190,17 +190,17 @@ public function migrate(string $migrationFile, string $act): void
190190
}
191191

192192
// Load the migration class instance
193-
$instance = DiClasses::load($className);
193+
$instance = Resolver::resolveClass($className);
194194

195195
// Perform migration based on the action (up or down)
196196
if ($act === 'up') {
197-
if (!method_exists($instance, 'up')) {
197+
if (!method_exists($className, 'up')) {
198198
throw new \Exception("Undefined method 'up' in $filename.");
199199
}
200200
$instance->up();
201201
$this->migrated = true;
202202
} elseif ($act === 'down') {
203-
if (!method_exists($instance, 'down')) {
203+
if (!method_exists($className, 'down')) {
204204
throw new \Exception("Undefined method 'down' in $filename.");
205205
}
206206
$instance->down();

0 commit comments

Comments
 (0)