From 34f0053db743ca28a736587804396ff503bc22b1 Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass <95754414+bdalsass@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:18:11 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B07059=20-=20Symfony=206.4=20-=20Add=20mis?= =?UTF-8?q?sing=20namespaces=20to=20match=20PSR-4=20convention=20(#589)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userrightsprofile.class.inc.php | 2 + .../userrightsprofile.db.class.inc.php | 2 + .../userrightsprojection.class.inc.php | 2 + application/ajaxwebpage.class.inc.php | 1 + application/applicationextension.inc.php | 6 +- application/cmdbabstract.class.inc.php | 59 +++++++------ application/dashboard.class.inc.php | 16 ++-- application/dashboardlayout.class.inc.php | 3 +- application/dashlet.class.inc.php | 7 +- application/datatable.class.inc.php | 26 +++--- application/displayblock.class.inc.php | 16 ++-- application/excelexporter.class.inc.php | 4 + application/forms.class.inc.php | 3 +- application/logintwig.class.inc.php | 1 + application/loginwebpage.class.inc.php | 2 + application/maintenancemsg.php | 1 + application/menunode.class.inc.php | 7 +- application/query.class.inc.php | 1 + application/shortcut.class.inc.php | 1 + application/template.class.inc.php | 3 + application/ui.extkeywidget.class.inc.php | 7 +- application/ui.htmleditorwidget.class.inc.php | 1 + .../ui.linksdirectwidget.class.inc.php | 1 + application/ui.linkswidget.class.inc.php | 2 + application/ui.passwordwidget.class.inc.php | 2 + .../ui.searchformforeignkeys.class.inc.php | 2 + application/uiwizard.class.inc.php | 1 + application/utils.inc.php | 3 +- application/wizardhelper.class.inc.php | 4 +- composer.json | 3 + core/action.class.inc.php | 1 + core/attributedef.class.inc.php | 3 +- core/bulkchange.class.inc.php | 3 + core/bulkexport.class.inc.php | 5 +- core/csvbulkexport.class.inc.php | 4 +- core/dbobject.class.php | 1 + core/displayablegraph.class.inc.php | 7 +- core/event.class.inc.php | 3 + core/excelbulkexport.class.inc.php | 4 +- core/htmlbulkexport.class.inc.php | 4 +- core/ormcaselog.class.inc.php | 1 + core/ormdocument.class.inc.php | 1 + core/pdfbulkexport.class.inc.php | 5 +- core/spreadsheetbulkexport.class.inc.php | 4 +- core/tabularbulkexport.class.inc.php | 3 +- core/tagsetfield.class.inc.php | 4 +- core/userrights.class.inc.php | 1 + core/xmlbulkexport.class.inc.php | 4 +- datamodels/2.x/combodo-db-tools/dbtools.php | 5 +- .../itop-attachments/ajax.itop-attachment.php | 5 +- .../main.itop-attachments.php | 4 +- .../renderers.itop-attachments.php | 9 +- datamodels/2.x/itop-backup/ajax.backup.php | 4 + datamodels/2.x/itop-backup/backup.php | 4 +- datamodels/2.x/itop-backup/check-backup.php | 2 + .../2.x/itop-backup/common.cli-execution.php | 3 + datamodels/2.x/itop-backup/restore.php | 4 +- datamodels/2.x/itop-backup/status.php | 1 + datamodels/2.x/itop-config/config.php | 1 + datamodels/2.x/itop-hub-connector/ajax.php | 2 + .../hubconnectorpage.class.inc.php | 3 + datamodels/2.x/itop-hub-connector/land.php | 4 + datamodels/2.x/itop-hub-connector/launch.php | 3 + .../2.x/itop-hub-connector/myextensions.php | 1 + .../Controller/AjaxOauthClientController.php | 2 +- .../2.x/itop-tickets/main.itop-tickets.php | 1 + js/utils.js | 2 +- lib/composer/autoload_classmap.php | 40 ++++----- lib/composer/autoload_files.php | 1 + lib/composer/autoload_static.php | 41 ++++----- lib/composer/installed.php | 4 +- pages/UI.php | 15 ++-- pages/UniversalSearch.php | 2 + pages/ajax.csvimport.php | 3 + pages/ajax.document.php | 2 + pages/ajax.render.php | 12 ++- pages/ajax.searchform.php | 1 + pages/audit.php | 3 + pages/csvimport.php | 4 + pages/logoff.php | 1 + pages/notifications.php | 3 +- pages/preferences.php | 3 + pages/run_query.php | 2 + pages/schema.php | 4 +- pages/tagadmin.php | 3 + portal/index.php | 2 + setup/ajax.dataloader.php | 3 + setup/compiler.class.inc.php | 6 +- setup/setuppage.class.inc.php | 1 + setup/setuputils.class.inc.php | 8 +- setup/wizardcontroller.class.inc.php | 1 + setup/wizardsteps.class.inc.php | 8 +- .../Application/Helper/WebResourcesHelper.php | 15 ++-- .../Search/searchform.class.inc.php | 4 +- .../TwigBase/Controller/Controller.php | 10 +-- .../Application/TwigBase/Twig/TwigHelper.php | 6 +- .../DataTable/DataTableUIBlockFactory.php | 8 +- .../Layout/NavigationMenu/NavigationMenu.php | 3 +- .../Base/Layout/TabContainer/Tab/AjaxTab.php | 2 +- .../UI/Base/Layout/TabContainer/Tab/Tab.php | 2 +- .../Links/AbstractBlockLinkSetViewTable.php | 2 +- .../Direct/BlockDirectLinkSetEditTable.php | 6 +- .../BlockIndirectLinkSetEditTable.php | 4 +- sources/Application/WebPage/AjaxPage.php | 5 ++ .../Application/WebPage/CLILikeWebPage.php | 1 + sources/Application/WebPage/CLIPage.php | 5 ++ sources/Application/WebPage/CSVPage.php | 4 + .../Application/WebPage/CaptureWebPage.php | 5 ++ sources/Application/WebPage/DownloadPage.php | 2 + sources/Application/WebPage/ErrorPage.php | 6 ++ sources/Application/WebPage/JsonPPage.php | 9 +- sources/Application/WebPage/JsonPage.php | 3 + sources/Application/WebPage/NiceWebPage.php | 9 ++ sources/Application/WebPage/PDFPage.php | 7 +- sources/Application/WebPage/Page.php | 1 + sources/Application/WebPage/TabManager.php | 6 +- .../WebPage/UnauthenticatedWebPage.php | 85 +++++++++++++------ sources/Application/WebPage/WebPage.php | 64 ++++++++------ sources/Application/WebPage/XMLPage.php | 5 ++ sources/Application/WebPage/iTabbedPage.php | 2 + sources/Application/WebPage/iTopPDF.php | 8 +- sources/Application/WebPage/iTopWebPage.php | 31 +++++-- .../Application/WebPage/iTopWizardWebPage.php | 4 + sources/Controller/AjaxRenderController.php | 16 ++-- .../Base/Layout/ObjectController.php | 14 +-- .../Controller/Links/LinkSetController.php | 8 +- .../TemporaryObjectController.php | 2 +- sources/Core/Email/EmailLaminas.php | 2 +- .../Renderer/Console/ConsoleBlockRenderer.php | 9 +- .../ConsoleSelectObjectFieldRenderer.php | 2 +- sources/Service/Router/Router.php | 2 +- sources/alias.php | 34 ++++++++ symfony/config/services.yaml | 2 +- synchro/priv_sync_chunk.php | 3 + synchro/replica.php | 2 + synchro/synchro_exec.php | 3 + synchro/synchro_import.php | 3 + synchro/synchrodatasource.class.inc.php | 2 + .../backoffice/ajaxpage/layout.html.twig | 6 +- .../pages/backoffice/webpage/layout.html.twig | 2 +- .../Backoffice/RenderAllUiBlocks.php | 2 +- .../legacy-tests/GroupByAndFunctions.php | 2 + .../php-unit-tests/legacy-tests/VerifyOQL.php | 2 + .../legacy-tests/replay_query_log.php | 3 + .../Helper/WebResourcesHelperTest.php | 2 +- webservices/backoffice.dataloader.php | 5 +- webservices/cron.php | 6 +- webservices/export-v2.php | 7 ++ webservices/export.php | 7 ++ webservices/import.php | 3 + webservices/rest.php | 3 + 151 files changed, 669 insertions(+), 289 deletions(-) create mode 100644 sources/alias.php diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index 3c3725f13..d9a35fe1f 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -4,6 +4,8 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ +use Combodo\iTop\Application\WebPage\WebPage; + define('ADMIN_PROFILE_NAME', 'Administrator'); define('PORTAL_PROFILE_NAME', 'Portal user'); diff --git a/addons/userrights/userrightsprofile.db.class.inc.php b/addons/userrights/userrightsprofile.db.class.inc.php index 1c890baad..75bab6d15 100644 --- a/addons/userrights/userrightsprofile.db.class.inc.php +++ b/addons/userrights/userrightsprofile.db.class.inc.php @@ -17,6 +17,8 @@ * You should have received a copy of the GNU Affero General Public License */ +use Combodo\iTop\Application\WebPage\WebPage; + define('ADMIN_PROFILE_NAME', 'Administrator'); define('PORTAL_PROFILE_NAME', 'Portal user'); diff --git a/addons/userrights/userrightsprojection.class.inc.php b/addons/userrights/userrightsprojection.class.inc.php index 50413fabc..030c4f8a1 100644 --- a/addons/userrights/userrightsprojection.class.inc.php +++ b/addons/userrights/userrightsprojection.class.inc.php @@ -17,6 +17,8 @@ * You should have received a copy of the GNU Affero General Public License */ +use Combodo\iTop\Application\WebPage\WebPage; + define('ADMIN_PROFILE_ID', 1); class UserRightsBaseClass extends cmdbAbstractObject diff --git a/application/ajaxwebpage.class.inc.php b/application/ajaxwebpage.class.inc.php index ea0ef04ea..c5ffbe23b 100644 --- a/application/ajaxwebpage.class.inc.php +++ b/application/ajaxwebpage.class.inc.php @@ -7,6 +7,7 @@ // cannot notify depreciation for now as this is still load in autoloader //DeprecatedCallsLog::NotifyDeprecatedFile('moved to sources/Application/WebPage/AjaxPage.php, now loadable using autoloader'); +use Combodo\iTop\Application\WebPage\AjaxPage; /** * Class ajax_page diff --git a/application/applicationextension.inc.php b/application/applicationextension.inc.php index 13a9ecdf7..b3fde51ae 100644 --- a/application/applicationextension.inc.php +++ b/application/applicationextension.inc.php @@ -19,6 +19,8 @@ */ use Combodo\iTop\Application\UI\Base\iUIBlock; +use Combodo\iTop\Application\WebPage\iTopWebPage; +use Combodo\iTop\Application\WebPage\WebPage; use Symfony\Component\DependencyInjection\Container; require_once(APPROOT.'application/newsroomprovider.class.inc.php'); @@ -270,14 +272,14 @@ interface iPreferencesExtension { /** * @api - * @param \WebPage $oPage + * @param WebPage $oPage * */ public function DisplayPreferences(WebPage $oPage); /** * @api - * @param \WebPage $oPage + * @param WebPage $oPage * @param string $sOperation * * @return bool true if the operation has been used diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index bb6f0356c..8ed4f7eef 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -42,6 +42,9 @@ use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory; use Combodo\iTop\Application\UI\Links\Direct\BlockDirectLinkSetViewTable; use Combodo\iTop\Application\UI\Links\Indirect\BlockIndirectLinkSetViewTable; use Combodo\iTop\Application\UI\Links\Set\LinkSetUIBlockFactory; +use Combodo\iTop\Application\WebPage\AjaxPage; +use Combodo\iTop\Application\WebPage\iTopWebPage; +use Combodo\iTop\Application\WebPage\WebPage; use Combodo\iTop\Renderer\BlockRenderer; use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer; use Combodo\iTop\Renderer\Console\ConsoleFormRenderer; @@ -285,7 +288,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param \cmdbAbstractObject $oObj * @param array $aParams * @@ -354,7 +357,7 @@ JS * @param int $iKey The identifier of the object * @param string $sMessageId Your id or one of the well-known ids: 'create', 'update' and 'apply_stimulus' * @param string $sMessage The HTML message (must be correctly escaped) - * @param string $sSeverity Any of the \WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants + * @param string $sSeverity Any of the WebPage::ENUM_SESSION_MESSAGE_SEVERITY_XXX constants * @param float $fRank Ordering of the message: smallest displayed first (can be negative) * @param bool $bMustNotExist Do not alter any existing message (considering the id) * @@ -376,7 +379,7 @@ JS } /** - * @param \WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page! + * @param WebPage $oPage Warning, since 3.0.0 this parameter was kept for compatibility reason. You shouldn't write directly on the page! * When writing to the page, markup will be put above the real header of the panel. * To insert something IN the panel, we now need to add UIBlocks in either the "subtitle" or "toolbar" sections of the array that will be returned. * @param bool $bEditMode Deprecated parameter in iTop 3.0.0, use {@see GetDisplayMode()} and ENUM_DISPLAY_MODE_* constants instead @@ -554,7 +557,7 @@ HTML /** * Display properties tab of an object * - * @param \WebPage $oPage + * @param WebPage $oPage * @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead * @param string $sPrefix * @param array $aExtraParams @@ -593,7 +596,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param $sAttCode * * @throws \Exception @@ -634,7 +637,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead * * @throws \CoreException @@ -861,7 +864,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param bool $bEditMode Note that this parameter is no longer used in this method. Use {@see static::$sDisplayMode} instead * @param string $sPrefix * @param array $aExtraParams @@ -1065,7 +1068,7 @@ HTML /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param bool $bEditMode Note that this parameter is no longer used in this method, {@see static::$sDisplayMode} is used instead, but we cannot remove it as it part of the base interface (iDisplay)... * * @throws \ApplicationException @@ -1112,7 +1115,7 @@ HTML } // Note: DisplayBareHeader is called before adding $oObjectDetails to the page, so it can inject HTML before it through $oPage. - /** @var \iTopWebPage $oPage */ + /** @var iTopWebPage $oPage */ $aHeadersBlocks = $this->DisplayBareHeader($oPage, $bEditMode); if (false === empty($aHeadersBlocks['subtitle'])) { $oObjectDetails->AddSubTitleBlocks($aHeadersBlocks['subtitle']); @@ -1147,7 +1150,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * * @throws \ArchivedObjectException * @throws \CoreException @@ -1170,7 +1173,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param \CMDBObjectSet $oSet * @param array $aExtraParams See possible values in {@see DataTableUIBlockFactory::RenderDataTable()} * @@ -1232,7 +1235,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param \DBObjectSet $oSet * @param array $aExtraParams * @@ -1404,7 +1407,7 @@ HTML } /** - * @param \WebPage $oPage + * @param WebPage $oPage * @param \CMDBObjectSet $oSet * @param array $aExtraParams key used : *