Skip to content

Commit 450abeb

Browse files
committed
Merge remote-tracking branch 'origin/AC-3483' into Hammer-PlatformHealth-30sep24
2 parents 361fb0e + 5a5f85b commit 450abeb

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/Analyzer/SystemXml/Analyzer.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function analyze($registryBefore, $registryAfter)
144144
* @param string $filePath
145145
* @return string|null
146146
*/
147-
private function getBaseDir($filePath)
147+
private function getBaseDir($filePath): ?string
148148
{
149149
$currentDir = dirname($filePath);
150150
while ($currentDir !== '/' && $currentDir !== false) {
@@ -164,7 +164,7 @@ private function getBaseDir($filePath)
164164
* @param string $excludeFile The file to exclude from the search.
165165
* @return array An array of paths to system.xml files, excluding the specified file.
166166
*/
167-
private function getSystemXmlFiles($magentoBaseDir, $excludeFile = null)
167+
private function getSystemXmlFiles($magentoBaseDir, $excludeFile = null): array
168168
{
169169
$systemXmlFiles = [];
170170
$directoryToSearch = [
@@ -195,7 +195,7 @@ private function getSystemXmlFiles($magentoBaseDir, $excludeFile = null)
195195
* @param $nodePath
196196
* @return array|null
197197
*/
198-
private function extractSectionGroupField($nodePath)
198+
private function extractSectionGroupField($nodePath): ?array
199199
{
200200
$parts = explode('/', $nodePath);
201201

@@ -218,7 +218,7 @@ private function extractSectionGroupField($nodePath)
218218
* @return array
219219
* @throws \ReflectionException
220220
*/
221-
private function getNodeData($node)
221+
private function getNodeData($node): array
222222
{
223223
$data = [];
224224

@@ -309,8 +309,9 @@ private function reportAddedNodes(string $file, array $nodes)
309309
*
310310
* @param string $file
311311
* @param NodeInterface[] $nodes
312+
* @return void
312313
*/
313-
private function reportDuplicateNodes(string $file, array $nodes)
314+
private function reportDuplicateNodes(string $file, array $nodes): void
314315
{
315316
foreach ($nodes as $node) {
316317
switch (true) {
@@ -326,8 +327,9 @@ private function reportDuplicateNodes(string $file, array $nodes)
326327
*
327328
* @param array $modules
328329
* @param XmlRegistry $registryBefore
330+
* @return void
329331
*/
330-
private function reportRemovedFiles(array $modules, XmlRegistry $registryBefore)
332+
private function reportRemovedFiles(array $modules, XmlRegistry $registryBefore): void
331333
{
332334
foreach ($modules as $module) {
333335
$beforeFile = $registryBefore->mapping[XmlRegistry::NODES_KEY][$module];
@@ -340,8 +342,9 @@ private function reportRemovedFiles(array $modules, XmlRegistry $registryBefore)
340342
*
341343
* @param string $file
342344
* @param NodeInterface[] $nodes
345+
* @return void
343346
*/
344-
private function reportRemovedNodes(string $file, array $nodes)
347+
private function reportRemovedNodes(string $file, array $nodes): void
345348
{
346349
foreach ($nodes as $node) {
347350
switch (true) {
@@ -360,15 +363,14 @@ private function reportRemovedNodes(string $file, array $nodes)
360363
}
361364
}
362365

363-
/**
364-
* @param string|null $baseDir
365-
* @param string $sectionId
366-
* @param string $groupId
367-
* @param string $fieldId
368-
* @param string $afterFile
369-
* @return array
370-
* @throws \Exception
371-
*/
366+
/**
367+
* @param string|null $baseDir
368+
* @param string $sectionId
369+
* @param string $groupId
370+
* @param string|null $fieldId
371+
* @param string $afterFile
372+
* @return array
373+
*/
372374
private function isDuplicatedFieldInXml(
373375
?string $baseDir,
374376
string $sectionId,
@@ -406,7 +408,6 @@ private function isDuplicatedFieldInXml(
406408
[
407409
'status' => 'duplicate',
408410
'field' => $fieldId
409-
410411
]
411412
];
412413
}

0 commit comments

Comments
 (0)