Skip to content

Commit 397b759

Browse files
ashishkumarpundeerashishkumarpundeer
ashishkumarpundeer
authored and
ashishkumarpundeer
committed
AC-9027::get_class(): Argument #1 () must be of type object, string given in magento/framework/Setup/Patch/PatchApplier
1 parent 732c099 commit 397b759

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -237,22 +237,23 @@ public function applySchemaPatch($moduleName = null)
237237
continue;
238238
}
239239
/**
240-
* @var SchemaPatchInterface $schemaPatchObject
240+
* @var SchemaPatchInterface $schemaPatch
241241
*/
242-
$schemaPatchObject = $this->patchFactory->create($schemaPatch, ['schemaSetup' => $this->schemaSetup]);
243-
$schemaPatchObject->apply();
244-
$this->patchHistory->fixPatch(get_class($schemaPatchObject));
245-
foreach ($schemaPatchObject->getAliases() as $patchAlias) {
242+
$schemaPatch = $this->patchFactory->create($schemaPatch, ['schemaSetup' => $this->schemaSetup]);
243+
$schemaPatch->apply();
244+
$this->patchHistory->fixPatch(get_class($schemaPatch));
245+
foreach ($schemaPatch->getAliases() as $patchAlias) {
246246
if (!$this->patchHistory->isApplied($patchAlias)) {
247247
$this->patchHistory->fixPatch($patchAlias);
248248
}
249249
}
250250
} catch (\Exception $e) {
251+
$schemaPatchClass = is_object($schemaPatch) ? get_class($schemaPatch) : $schemaPatch;
251252
throw new SetupException(
252253
new Phrase(
253254
'Unable to apply patch %1 for module %2. Original exception message: %3',
254255
[
255-
$schemaPatch,
256+
$schemaPatchClass,
256257
$moduleName,
257258
$e->getMessage()
258259
]

0 commit comments

Comments
 (0)