Skip to content

Commit d84ec1e

Browse files
committed
feat: enhance VendorFileMapper with type hinting for registry handling
1 parent 110cc92 commit d84ec1e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Service/VendorFileMapper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ function () {
233233
);
234234

235235
if ($registry) {
236+
/** @var \Hyva\CompatModuleFallback\Model\CompatModuleRegistry $registry */
236237
return $this->findOriginalModuleInRegistry($registry, $compatModuleName);
237238
}
238239
} catch (\Throwable $e) {
@@ -255,9 +256,11 @@ private function findOriginalModuleInRegistry($registry, string $compatModuleNam
255256
{
256257
// Iterate through original modules to find if current module is a registered compat module
257258
// We call getOrigModules inside the emulation callback ideally, but here we got the object
258-
foreach ($registry->getOrigModules() as $originalModule) {
259+
/** @var mixed $mixedRegistry */
260+
$mixedRegistry = $registry;
261+
foreach ($mixedRegistry->getOrigModules() as $originalModule) {
259262
// Get compat modules for this original module
260-
$compatModules = $registry->getCompatModulesFor($originalModule);
263+
$compatModules = $mixedRegistry->getCompatModulesFor($originalModule);
261264

262265
// Check exact match first
263266
if (in_array($compatModuleName, $compatModules, true)) {
@@ -363,8 +366,6 @@ private function parseDiFileForCompatModule(string $diPath, string $moduleName):
363366
}
364367

365368
/**
366-
* Find original module in XML items
367-
*
368369
* @param \DOMNodeList<\DOMNode> $items
369370
* @param \DOMXPath $xpath
370371
* @param string $moduleName

0 commit comments

Comments
 (0)