$search =
[ pathinfo($filename, \PATHINFO_FILENAME
),
'return ' .
$timestamp . ';',
];
$replace =
[ str_replace($timestamp,
$newTimestamp,
$className),
'return ' .
$newTimestamp . ';',
];
$this->
updateMigrationFile($path,
$search,
$replace);
rename($path,
$newPath);
return self::SUCCESS;
} private function getCurrentTimestamp(string
$filename): string
{ if (!
preg_match('#Migration([\d]+).*?\.php#i',
$filename,
$matches)) { throw new \
RuntimeException('Could not determine current timestamp.'
);
}