N°8796 - Add PHP code style validation in iTop and extensions - format whole code base

This commit is contained in:
odain
2025-11-07 15:39:53 +01:00
parent 12f23113f5
commit 890a2568c8
2110 changed files with 53099 additions and 63885 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
* This file is part of iTop.
@@ -19,7 +20,6 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
use DOMDocument;
use iTopDesignFormat;
/**
* @covers iTopDesignFormat
*
@@ -35,7 +35,6 @@ class iTopModulesXmlVersionIntegrationTest extends ItopTestCase
$this->RequireOnceItopFile('setup/itopdesignformat.class.inc.php');
}
/**
* Verify if the `datamodels/2.x/datamodel.*.xml` files refer to the latest version of the design
* This is an integration test
@@ -61,8 +60,11 @@ class iTopModulesXmlVersionIntegrationTest extends ItopTestCase
if ($oFormat->Convert()) {
// Compare the original and new format
$sExpectedXmlVersion = ITOP_DESIGN_LATEST_VERSION;
$this->assertSame($oTransformedXml->saveXML(), $oOriginalXml->saveXML(),
"Datamodel file $sXmlFile:2 not in the latest format ($sExpectedXmlVersion)");
$this->assertSame(
$oTransformedXml->saveXML(),
$oOriginalXml->saveXML(),
"Datamodel file $sXmlFile:2 not in the latest format ($sExpectedXmlVersion)"
);
} else {
$this->fail("Failed to convert $sXmlFile into the latest format");
}
@@ -80,11 +82,11 @@ class iTopModulesXmlVersionIntegrationTest extends ItopTestCase
$aXmlFiles[] = $sAppRoot.'core/datamodel.core.xml';
$aXmlFiles[] = $sAppRoot.'application/datamodel.application.xml';
$aTestCases = array();
$aTestCases = [];
foreach ($aXmlFiles as $sXmlFile) {
$aTestCases[$sXmlFile] = array(
$aTestCases[$sXmlFile] = [
'sXmlFile' => $sXmlFile,
);
];
}
return $aTestCases;