From c228c7f7f83fc49d04b423493cde0f49522c4f13 Mon Sep 17 00:00:00 2001 From: tbaddade Date: Fri, 19 Apr 2024 17:14:55 +0200 Subject: [PATCH 01/25] rex_context -> Http\Context, rex_context_provider_interface -> Http\ContextProviderInterface, rex_url_provider_interface -> Base\UrlProviderInterface --- redaxo/src/core/backend.php | 3 +- .../fragments/core/navigations/pagination.php | 3 +- redaxo/src/core/lib/list.php | 3 +- redaxo/src/core/lib/setup/setup.php | 5 +- .../content/extension_point/slice_menu.php | 6 ++- redaxo/src/core/lib/view.php | 7 +-- redaxo/src/core/pages/mediapool.media.php | 3 +- redaxo/src/core/pages/metainfo.content.php | 3 +- redaxo/src/core/pages/setup.step1.php | 3 +- redaxo/src/core/pages/setup.step2.php | 3 +- redaxo/src/core/pages/setup.step3.php | 3 +- redaxo/src/core/pages/setup.step4.php | 3 +- redaxo/src/core/pages/setup.step5.php | 3 +- .../pages/structure.content.functions.php | 3 +- redaxo/src/core/pages/structure.content.php | 3 +- redaxo/src/core/pages/structure.linkmap.php | 3 +- src/ApiFunction/ApiFunction.php | 4 +- src/Backend/Controller.php | 4 +- src/Base/UrlProviderInterface.php | 17 ++++++ src/Content/ApiFunction/ArticleCopy.php | 4 +- src/Content/ArticleContentEditor.php | 6 +-- src/Content/Linkmap/ArticleList.php | 4 +- src/Content/Linkmap/CategoryTree.php | 4 +- src/Content/Linkmap/CategoryTreeRenderer.php | 4 +- src/Content/StructureContext.php | 6 +-- .../lib/context.php => src/Http/Context.php | 54 +++++-------------- src/Http/ContextProviderInterface.php | 21 ++++++++ .../Http/ContextTest.php | 15 +++--- 28 files changed, 115 insertions(+), 85 deletions(-) create mode 100644 src/Base/UrlProviderInterface.php rename redaxo/src/core/lib/context.php => src/Http/Context.php (67%) create mode 100644 src/Http/ContextProviderInterface.php rename redaxo/src/core/tests/context_test.php => tests/Http/ContextTest.php (92%) diff --git a/redaxo/src/core/backend.php b/redaxo/src/core/backend.php index b59d669a34..057808f70c 100644 --- a/redaxo/src/core/backend.php +++ b/redaxo/src/core/backend.php @@ -11,6 +11,7 @@ use Redaxo\Core\Filesystem\File; use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Context; use Redaxo\Core\Language\Language; use Redaxo\Core\Security\BackendLogin; use Redaxo\Core\Security\CsrfToken; @@ -464,7 +465,7 @@ static function (rex_extension_point $ep) { } $revisions[ArticleRevision::WORK] = I18n::msg('version_workingversion'); - $context = new rex_context([ + $context = new Context([ 'page' => $params['page'], 'article_id' => $articleId, 'clang' => $clangId, diff --git a/redaxo/src/core/fragments/core/navigations/pagination.php b/redaxo/src/core/fragments/core/navigations/pagination.php index 1919039334..5fb9350b9a 100644 --- a/redaxo/src/core/fragments/core/navigations/pagination.php +++ b/redaxo/src/core/fragments/core/navigations/pagination.php @@ -1,5 +1,6 @@ pager; - /** @var rex_url_provider_interface $urlProvider */ + /** @var UrlProviderInterface $urlProvider */ $urlProvider = $this->urlprovider; $firstPage = $pager->getFirstPage(); diff --git a/redaxo/src/core/lib/list.php b/redaxo/src/core/lib/list.php index 1d9d01c1a2..4769eca044 100644 --- a/redaxo/src/core/lib/list.php +++ b/redaxo/src/core/lib/list.php @@ -2,6 +2,7 @@ use Redaxo\Core\Backend\Controller; use Redaxo\Core\Base\FactoryTrait; +use Redaxo\Core\Base\UrlProviderInterface; use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; use Redaxo\Core\Filesystem\Url; @@ -58,7 +59,7 @@ function callback_func($params) * * @psalm-consistent-constructor */ -class rex_list implements rex_url_provider_interface +class rex_list implements UrlProviderInterface { use FactoryTrait; diff --git a/redaxo/src/core/lib/setup/setup.php b/redaxo/src/core/lib/setup/setup.php index c78717afdb..cd0cf94626 100644 --- a/redaxo/src/core/lib/setup/setup.php +++ b/redaxo/src/core/lib/setup/setup.php @@ -7,6 +7,7 @@ use Redaxo\Core\Filesystem\Finder; use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Context; use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Formatter; use Redaxo\Core\Util\Type; @@ -358,9 +359,9 @@ public static function isEnabled(): bool return isset($setup[$currentToken]); } - public static function getContext(): rex_context + public static function getContext(): Context { - $context = new rex_context([ + $context = new Context([ 'page' => 'setup', 'lang' => rex_request('lang', 'string', ''), 'step' => rex_request('step', 'int', 1), diff --git a/redaxo/src/core/lib/structure/content/extension_point/slice_menu.php b/redaxo/src/core/lib/structure/content/extension_point/slice_menu.php index f8f8bea12a..eedcced6d2 100644 --- a/redaxo/src/core/lib/structure/content/extension_point/slice_menu.php +++ b/redaxo/src/core/lib/structure/content/extension_point/slice_menu.php @@ -1,5 +1,7 @@ */ @@ -22,7 +24,7 @@ public function __construct( private array $menuStatusAction, private array $menuMoveupAction, private array $menuMovedownAction, - private rex_context $context, + private Context $context, private string $fragment, private int $articleId, private int $clang, @@ -145,7 +147,7 @@ public function addAdditionalActions(array $additionalActions): void $this->additionalActions = array_merge($this->additionalActions, $additionalActions); } - public function getContext(): rex_context + public function getContext(): Context { return $this->context; } diff --git a/redaxo/src/core/lib/view.php b/redaxo/src/core/lib/view.php index f3bc843c59..172fcde54b 100644 --- a/redaxo/src/core/lib/view.php +++ b/redaxo/src/core/lib/view.php @@ -5,6 +5,7 @@ use Redaxo\Core\Backend\Page; use Redaxo\Core\Core; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Context; use Redaxo\Core\Language\Language; use Redaxo\Core\Translation\I18n; @@ -341,7 +342,7 @@ public static function title($head, $subtitle = null) * * @return string */ - public static function clangSwitch(rex_context $context, $asDropDown = true) + public static function clangSwitch(Context $context, $asDropDown = true) { if (1 == Language::count()) { return ''; @@ -377,7 +378,7 @@ public static function clangSwitch(rex_context $context, $asDropDown = true) * * @return string */ - public static function clangSwitchAsButtons(rex_context $context, $asDropDown = true) + public static function clangSwitchAsButtons(Context $context, $asDropDown = true) { if (1 == Language::count()) { return ''; @@ -413,7 +414,7 @@ public static function clangSwitchAsButtons(rex_context $context, $asDropDown = * * @return string */ - public static function clangSwitchAsDropdown(rex_context $context) + public static function clangSwitchAsDropdown(Context $context) { if (1 == Language::count()) { return ''; diff --git a/redaxo/src/core/pages/mediapool.media.php b/redaxo/src/core/pages/mediapool.media.php index 02f42fb7e7..719ad2767d 100644 --- a/redaxo/src/core/pages/mediapool.media.php +++ b/redaxo/src/core/pages/mediapool.media.php @@ -4,6 +4,7 @@ use Redaxo\Core\Core; use Redaxo\Core\Filesystem\Url; use Redaxo\Core\Form\Select\MediaCategorySelect; +use Redaxo\Core\Http\Context; use Redaxo\Core\Security\CsrfToken; use Redaxo\Core\Translation\I18n; @@ -65,7 +66,7 @@ '; -$context = new rex_context([ +$context = new Context([ 'page' => Controller::getCurrentPage(), ]); diff --git a/redaxo/src/core/pages/metainfo.content.php b/redaxo/src/core/pages/metainfo.content.php index 75820dc41f..d53cd4bc1e 100644 --- a/redaxo/src/core/pages/metainfo.content.php +++ b/redaxo/src/core/pages/metainfo.content.php @@ -7,6 +7,7 @@ use Redaxo\Core\Content\StructureContext; use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; +use Redaxo\Core\Http\Context; use Redaxo\Core\MetaInfo\Handler\ArticleHandler as MetaInfoArticleHandler; use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Formatter; @@ -95,7 +96,7 @@ $ctype = 1; } // default = 1 - $context = new rex_context([ + $context = new Context([ 'page' => Controller::getCurrentPage(), 'article_id' => $articleId, 'clang' => $clang, diff --git a/redaxo/src/core/pages/setup.step1.php b/redaxo/src/core/pages/setup.step1.php index 23ea1bfef4..68eb356353 100644 --- a/redaxo/src/core/pages/setup.step1.php +++ b/redaxo/src/core/pages/setup.step1.php @@ -1,8 +1,9 @@ Controller::getCurrentPage(), 'article_id' => $articleId, 'category_id' => $categoryId, diff --git a/redaxo/src/core/pages/structure.linkmap.php b/redaxo/src/core/pages/structure.linkmap.php index 744bed603e..09f848f0e5 100644 --- a/redaxo/src/core/pages/structure.linkmap.php +++ b/redaxo/src/core/pages/structure.linkmap.php @@ -4,6 +4,7 @@ use Redaxo\Core\Content\Category; use Redaxo\Core\Content\Linkmap\ArticleList; use Redaxo\Core\Content\Linkmap\CategoryTree; +use Redaxo\Core\Http\Context; use Redaxo\Core\Language\Language; use Redaxo\Core\Translation\I18n; @@ -24,7 +25,7 @@ throw new InvalidArgumentException(sprintf('Invalid character "%s" in opener_input_field_name.', $match[0])); } -$context = new rex_context([ +$context = new Context([ 'page' => Controller::getCurrentPage(), 'opener_input_field' => $openerInputField, 'opener_input_field_name' => $openerInputFieldName, diff --git a/src/ApiFunction/ApiFunction.php b/src/ApiFunction/ApiFunction.php index a2b253126a..5086d32949 100644 --- a/src/ApiFunction/ApiFunction.php +++ b/src/ApiFunction/ApiFunction.php @@ -8,11 +8,11 @@ use Redaxo\Core\Base\FactoryTrait; use Redaxo\Core\Content\ApiFunction as ContentApiFunction; use Redaxo\Core\Core; +use Redaxo\Core\Http\Context; use Redaxo\Core\MetaInfo\ApiFunction\DefaultFieldsCreate; use Redaxo\Core\Security\ApiFunction as SecurityApiFunction; use Redaxo\Core\Security\CsrfToken; use Redaxo\Core\Translation\I18n; -use rex_context; use rex_exception; use rex_http_exception; use rex_response; @@ -236,7 +236,7 @@ public static function handleCall() $apiFunc->result = $result; if ($result->requiresReboot()) { - $context = rex_context::fromGet(); + $context = Context::fromGet(); // add api call result to url $context->setParam(self::REQ_RESULT_PARAM, $result->toJSON()); // and redirect to SELF for reboot diff --git a/src/Backend/Controller.php b/src/Backend/Controller.php index d932d29676..70fba3146b 100644 --- a/src/Backend/Controller.php +++ b/src/Backend/Controller.php @@ -7,12 +7,12 @@ use Redaxo\Core\Database\Util; use Redaxo\Core\Filesystem\File; use Redaxo\Core\Filesystem\Path; +use Redaxo\Core\Http\Context; use Redaxo\Core\Security\User; use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Markdown; use Redaxo\Core\Util\Timer; use Redaxo\Core\Util\Type; -use rex_context; use rex_extension; use rex_fragment; use rex_request; @@ -596,7 +596,7 @@ public static function checkPagePermissions(User $user) } if ($page !== $leaf = $page->getFirstSubpagesLeaf()) { rex_response::setStatus(rex_response::HTTP_MOVED_PERMANENTLY); - $url = $leaf->hasHref() ? $leaf->getHref() : rex_context::fromGet()->getUrl(['page' => $leaf->getFullKey()]); + $url = $leaf->hasHref() ? $leaf->getHref() : Context::fromGet()->getUrl(['page' => $leaf->getFullKey()]); rex_response::sendRedirect($url); } } diff --git a/src/Base/UrlProviderInterface.php b/src/Base/UrlProviderInterface.php new file mode 100644 index 0000000000..c2535574f8 --- /dev/null +++ b/src/Base/UrlProviderInterface.php @@ -0,0 +1,17 @@ + Controller::getCurrentPage(), 'clang' => $clang, ]); diff --git a/src/Content/ArticleContentEditor.php b/src/Content/ArticleContentEditor.php index c6013df1e6..603deae679 100644 --- a/src/Content/ArticleContentEditor.php +++ b/src/Content/ArticleContentEditor.php @@ -8,8 +8,8 @@ use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Context; use Redaxo\Core\Translation\I18n; -use rex_context; use rex_extension; use rex_extension_point; use rex_extension_point_slice_menu; @@ -147,7 +147,7 @@ private function getSliceMenu(Sql $artDataSql) $moduleId = (int) $artDataSql->getValue(Core::getTablePrefix() . 'module.id'); $moduleName = I18n::translate((string) $artDataSql->getValue(Core::getTablePrefix() . 'module.name')); - $context = new rex_context([ + $context = new Context([ 'page' => Controller::getCurrentPage(), 'article_id' => $this->article_id, 'slice_id' => $sliceId, @@ -302,7 +302,7 @@ private function getWrappedModuleOutput($moduleId, $moduleOutput) private function getModuleSelect($sliceId) { // ----- BLOCKAUSWAHL - SELECT - $context = new rex_context([ + $context = new Context([ 'page' => Controller::getCurrentPage(), 'article_id' => $this->article_id, 'clang' => $this->clang, diff --git a/src/Content/Linkmap/ArticleList.php b/src/Content/Linkmap/ArticleList.php index c0471c5a38..ffab8ef3e1 100644 --- a/src/Content/Linkmap/ArticleList.php +++ b/src/Content/Linkmap/ArticleList.php @@ -3,7 +3,7 @@ namespace Redaxo\Core\Content\Linkmap; use Redaxo\Core\Content\Article; -use rex_context; +use Redaxo\Core\Http\Context; /** * @internal @@ -11,7 +11,7 @@ class ArticleList extends ArticleListRenderer { public function __construct( - private rex_context $context, + private Context $context, ) {} /** diff --git a/src/Content/Linkmap/CategoryTree.php b/src/Content/Linkmap/CategoryTree.php index d52216dc3a..fa73f415da 100644 --- a/src/Content/Linkmap/CategoryTree.php +++ b/src/Content/Linkmap/CategoryTree.php @@ -3,7 +3,7 @@ namespace Redaxo\Core\Content\Linkmap; use Redaxo\Core\Content\Category; -use rex_context; +use Redaxo\Core\Http\Context; use function count; @@ -13,7 +13,7 @@ class CategoryTree extends CategoryTreeRenderer { public function __construct( - private rex_context $context, + private Context $context, ) {} /** diff --git a/src/Content/Linkmap/CategoryTreeRenderer.php b/src/Content/Linkmap/CategoryTreeRenderer.php index 8fe1941573..bb643bc41b 100644 --- a/src/Content/Linkmap/CategoryTreeRenderer.php +++ b/src/Content/Linkmap/CategoryTreeRenderer.php @@ -6,8 +6,8 @@ use Redaxo\Core\Content\Category; use Redaxo\Core\Content\StructureElement; use Redaxo\Core\Core; +use Redaxo\Core\Http\Context; use Redaxo\Core\Translation\I18n; -use rex_context; use function count; use function in_array; @@ -109,7 +109,7 @@ public static function formatLabel(StructureElement $OOobject) /** * @return string */ - public static function formatLi(StructureElement $OOobject, $currentCategoryId, rex_context $context, $liAttr = '', $linkAttr = '') + public static function formatLi(StructureElement $OOobject, $currentCategoryId, Context $context, $liAttr = '', $linkAttr = '') { $linkAttr .= ' class="' . ($OOobject->isOnline() ? 'rex-online' : 'rex-offline') . '"'; diff --git a/src/Content/StructureContext.php b/src/Content/StructureContext.php index 45aa33f5b2..4a4f158611 100644 --- a/src/Content/StructureContext.php +++ b/src/Content/StructureContext.php @@ -3,8 +3,8 @@ namespace Redaxo\Core\Content; use Redaxo\Core\Core; +use Redaxo\Core\Http\Context; use Redaxo\Core\Language\Language; -use rex_context; use function count; @@ -103,9 +103,9 @@ public function getRowsPerPage(): int return (int) $this->getValue('rows_per_page', 30); } - public function getContext(): rex_context + public function getContext(): Context { - return new rex_context([ + return new Context([ 'page' => 'structure', 'category_id' => $this->getCategoryId(), 'article_id' => $this->getArticleId(), diff --git a/redaxo/src/core/lib/context.php b/src/Http/Context.php similarity index 67% rename from redaxo/src/core/lib/context.php rename to src/Http/Context.php index 5040d9da5e..0432e0d43f 100644 --- a/redaxo/src/core/lib/context.php +++ b/src/Http/Context.php @@ -1,45 +1,17 @@ $globalParams A array containing only scalar values for key/value */ @@ -108,7 +80,7 @@ public function removeParam(string $name): void } /** - * @see rex_context_provider::getHiddenInputFields() + * @see ContextProviderInterface::getHiddenInputFields() */ public function getHiddenInputFields(array $params = []) { @@ -119,9 +91,9 @@ public function getHiddenInputFields(array $params = []) } /** - * Returns a rex_context instance containing all GET and POST parameters. + * Returns a Context instance containing all GET and POST parameters. * - * @return self + * @return Context */ public static function restore() { @@ -130,9 +102,9 @@ public static function restore() } /** - * Returns a rex_context instance containing all GET parameters. + * Returns a Context instance containing all GET parameters. * - * @return self + * @return Context */ public static function fromGet() { @@ -140,9 +112,9 @@ public static function fromGet() } /** - * Returns a rex_context instance containing all POST parameters. + * Returns a Context instance containing all POST parameters. * - * @return self + * @return Context */ public static function fromPost() { @@ -152,7 +124,7 @@ public static function fromPost() /** * Helper method to generate a html string with hidden input fields from an array key-value pairs. * - * @param array $array The array which contains the key-value pairs for convertion + * @param array $array The array which contains the key-value pairs for conversion * * @return string */ diff --git a/src/Http/ContextProviderInterface.php b/src/Http/ContextProviderInterface.php new file mode 100644 index 0000000000..57871436c8 --- /dev/null +++ b/src/Http/ContextProviderInterface.php @@ -0,0 +1,21 @@ + '25', 'str' => '']; - $context = new rex_context($globalParams); + $context = new Context($globalParams); self::assertEquals('index.php?int=25&str=%3Ca+b%24c%26%3F%3E', $context->getUrl(), 'parameters get properly encoded'); self::assertEquals('index.php?int=25&str=xyz', $context->getUrl(['str' => 'xyz']), 'local params override global params'); @@ -20,7 +23,7 @@ public function testGetUrl(): void public function testGetHiddenInputFields(): void { $globalParams = ['int' => '25', 'str' => '']; - $context = new rex_context($globalParams); + $context = new Context($globalParams); self::assertEquals( '', @@ -64,7 +67,7 @@ public function testFromGet(): void $key = 'context_test_get'; $_GET[$key] = 1; - $context = rex_context::fromGet(); + $context = Context::fromGet(); self::assertEquals($_GET[$key], $context->getParam($key)); } @@ -74,7 +77,7 @@ public function testFromPost(): void $key = 'context_test_post'; $_POST[$key] = 'foo'; - $context = rex_context::fromPost(); + $context = Context::fromPost(); self::assertEquals($_POST[$key], $context->getParam($key)); } @@ -86,7 +89,7 @@ public function testRestore(): void $_GET[$keyGet] = 'foo'; $_POST[$keyPost] = 'bar'; - $context = rex_context::restore(); + $context = Context::restore(); self::assertEquals($_GET[$keyGet], $context->getParam($keyGet)); self::assertEquals($_POST[$keyPost], $context->getParam($keyPost)); From e7bae88dfed73062f39e718586c7c537dad7c200 Mon Sep 17 00:00:00 2001 From: tbaddade Date: Fri, 19 Apr 2024 17:15:02 +0200 Subject: [PATCH 02/25] rector --- rector.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 2c1899d7ee..bb65e8f1ab 100644 --- a/rector.php +++ b/rector.php @@ -50,6 +50,7 @@ use Redaxo\Core\Database; use Redaxo\Core\Filesystem; use Redaxo\Core\Form; +use Redaxo\Core\Http; use Redaxo\Core\HttpClient; use Redaxo\Core\Language; use Redaxo\Core\Log; @@ -193,6 +194,8 @@ 'rex_cronjob_form' => Cronjob\Form\CronjobForm::class, 'rex_config' => Config::class, 'rex_config_db' => Database\Configuration::class, + 'rex_context' => Http\Context::class, + 'rex_context_provider_interface' => Http\ContextProviderInterface::class, 'rex_cronjob_form_interval_element' => Cronjob\Form\IntervalField::class, 'rex_cronjob' => Cronjob\Type\AbstractType::class, 'rex_cronjob_urlrequest' => Cronjob\Type\UrlRequestType::class, @@ -307,6 +310,7 @@ 'rex_instance_pool_trait' => Base\InstancePoolTrait::class, 'rex_singleton_trait' => Base\SingletonTrait::class, 'rex_url' => Filesystem\Url::class, + 'rex_url_provider_interface' => Base\UrlProviderInterface::class, 'rex_validator' => Validator\Validator::class, 'rex_validation_rule' => Validator\ValidationRule::class, 'rex_version' => Util\Version::class, @@ -412,7 +416,7 @@ ]) ->withConfiguredRule(ArgumentRemoverRector::class, [ new ArgumentRemover(Util\Str::class, 'buildQuery', 1, null), - new ArgumentRemover(rex_url_provider_interface::class, 'getUrl', 1, null), + new ArgumentRemover(Base\UrlProviderInterface::class, 'getUrl', 1, null), new ArgumentRemover(Filesystem\Url::class, 'frontendController', 1, null), new ArgumentRemover(Filesystem\Url::class, 'backendController', 1, null), new ArgumentRemover(Filesystem\Url::class, 'backendPage', 2, null), From bcf70453401fbc7ab30671d792080ca68d8aa4c1 Mon Sep 17 00:00:00 2001 From: tbaddade Date: Fri, 19 Apr 2024 18:08:12 +0200 Subject: [PATCH 03/25] rex_request -> Redaxo\Core\Http\Request --- rector.php | 1 + redaxo/src/addons/debug/boot.php | 3 ++- redaxo/src/core/backend.php | 7 +++--- redaxo/src/core/boot.php | 9 +++---- .../core/functions/function_rex_globals.php | 24 ++++++++++--------- redaxo/src/core/layout/bottom.php | 5 ++-- redaxo/src/core/layout/top.php | 7 +++--- redaxo/src/core/lib/error_handler.php | 3 ++- redaxo/src/core/lib/setup/setup.php | 3 ++- redaxo/src/core/lib/system_report.php | 3 ++- redaxo/src/core/pages/mediapool.php | 3 ++- redaxo/src/core/pages/packages.list.php | 2 +- redaxo/src/core/pages/setup.step3.php | 5 ++-- redaxo/src/core/pages/structure.content.php | 1 + redaxo/src/core/pages/structure.linkmap.php | 3 ++- src/Backend/Controller.php | 4 ++-- src/Http/Context.php | 2 ++ .../lib/request.php => src/Http/Request.php | 12 +++++++++- src/Security/ApiFunction/UserHasSession.php | 4 ++-- .../ApiFunction/UserRemoveAuthMethod.php | 6 ++--- .../ApiFunction/UserRemoveSession.php | 6 ++--- src/Security/CsrfToken.php | 4 ++-- src/Security/Login.php | 4 ++-- src/Security/UserSession.php | 6 ++--- .../Http/RequestTest.php | 3 ++- 25 files changed, 79 insertions(+), 51 deletions(-) rename redaxo/src/core/lib/request.php => src/Http/Request.php (97%) rename redaxo/src/core/tests/request_test.php => tests/Http/RequestTest.php (91%) diff --git a/rector.php b/rector.php index bb65e8f1ab..e43f7c5634 100644 --- a/rector.php +++ b/rector.php @@ -196,6 +196,7 @@ 'rex_config_db' => Database\Configuration::class, 'rex_context' => Http\Context::class, 'rex_context_provider_interface' => Http\ContextProviderInterface::class, + 'rex_request' => Http\Request::class, 'rex_cronjob_form_interval_element' => Cronjob\Form\IntervalField::class, 'rex_cronjob' => Cronjob\Type\AbstractType::class, 'rex_cronjob_urlrequest' => Cronjob\Type\UrlRequestType::class, diff --git a/redaxo/src/addons/debug/boot.php b/redaxo/src/addons/debug/boot.php index 1904060178..34a9d7f018 100644 --- a/redaxo/src/addons/debug/boot.php +++ b/redaxo/src/addons/debug/boot.php @@ -8,6 +8,7 @@ use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; use Redaxo\Core\Filesystem\Path; +use Redaxo\Core\Http\Request; use Redaxo\Core\Language\Language; use Redaxo\Core\Log\Logger; use Redaxo\Core\Util\Editor; @@ -17,7 +18,7 @@ return; } -if (Core::isBackend() && 'debug' === rex_request::get('page') && Core::getUser()?->isAdmin()) { +if (Core::isBackend() && 'debug' === Request::get('page') && Core::getUser()?->isAdmin()) { $index = file_get_contents(Addon::require('debug')->getAssetsPath('clockwork/index.html')); $editor = Editor::factory(); diff --git a/redaxo/src/core/backend.php b/redaxo/src/core/backend.php index 057808f70c..f41df0ecab 100644 --- a/redaxo/src/core/backend.php +++ b/redaxo/src/core/backend.php @@ -12,6 +12,7 @@ use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; use Redaxo\Core\Http\Context; +use Redaxo\Core\Http\Request; use Redaxo\Core\Language\Language; use Redaxo\Core\Security\BackendLogin; use Redaxo\Core\Security\CsrfToken; @@ -123,7 +124,7 @@ // Currently browsers like Safari do not support the header Clear-Site-Data. // we dont kill/regenerate the session so e.g. the frontend will not get logged out - rex_request::clearSession(); + Request::clearSession(); // is necessary for login after logout // and without the redirect, the csrf token would be invalid @@ -144,7 +145,7 @@ } if (true !== $loginCheck) { - if (rex_request::isXmlHttpRequest()) { + if (Request::isXmlHttpRequest()) { rex_response::setStatus(rex_response::HTTP_UNAUTHORIZED); } @@ -167,7 +168,7 @@ // Currently browsers like Safari do not support the header Clear-Site-Data. // we dont kill/regenerate the session so e.g. the frontend will not get logged out - rex_request::clearSession(); + Request::clearSession(); } } else { // Userspezifische Sprache einstellen diff --git a/redaxo/src/core/boot.php b/redaxo/src/core/boot.php index 8665dcd36d..468febd6bb 100644 --- a/redaxo/src/core/boot.php +++ b/redaxo/src/core/boot.php @@ -11,6 +11,7 @@ use Redaxo\Core\Filesystem\File; use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Request; use Redaxo\Core\Language\Language; use Redaxo\Core\Language\LanguagePermission; use Redaxo\Core\MediaManager\MediaManager; @@ -22,7 +23,7 @@ use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Timer; use Redaxo\Core\Util\VarDumper; -use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Request as BaseRequest; /** * REDAXO main boot file. @@ -129,7 +130,7 @@ date_default_timezone_set(Core::getProperty('timezone', 'Europe/Berlin')); if ('cli' !== PHP_SAPI) { - Core::setProperty('request', Request::createFromGlobals()); + Core::setProperty('request', BaseRequest::createFromGlobals()); } rex_error_handler::register(); @@ -157,11 +158,11 @@ // ----------------- HTTPS REDIRECT if ('cli' !== PHP_SAPI && !Core::isSetup()) { - if ((true === Core::getProperty('use_https') || Core::getEnvironment() === Core::getProperty('use_https')) && !rex_request::isHttps()) { + if ((true === Core::getProperty('use_https') || Core::getEnvironment() === Core::getProperty('use_https')) && !Request::isHttps()) { rex_response::enforceHttps(); } - if (true === Core::getProperty('use_hsts') && rex_request::isHttps()) { + if (true === Core::getProperty('use_hsts') && Request::isHttps()) { rex_response::setHeader('Strict-Transport-Security', 'max-age=' . (int) Core::getProperty('hsts_max_age', 31536000)); // default 1 year } } diff --git a/redaxo/src/core/functions/function_rex_globals.php b/redaxo/src/core/functions/function_rex_globals.php index 2cd6c040ef..e8c7ae41f0 100644 --- a/redaxo/src/core/functions/function_rex_globals.php +++ b/redaxo/src/core/functions/function_rex_globals.php @@ -1,5 +1,7 @@ hasLayout()) { - if (rex_request::isPJAXRequest()) { + if (Request::isPJAXRequest()) { echo ''; } @@ -18,7 +19,7 @@ ' . rex_escape(Controller::getPageTitle()) . ''; } if (!$curPage->hasLayout()) { - if (rex_request::isPJAXRequest()) { + if (Request::isPJAXRequest()) { echo '
'; } @@ -207,7 +208,7 @@ } /* PJAX Footer Header ********************************************************** */ -if (!rex_request::isPJAXContainer('#rex-js-page-container')) { +if (!Request::isPJAXContainer('#rex-js-page-container')) { $fragment = new rex_fragment(); $fragment->setVar('pageTitle', Controller::getPageTitle()); $fragment->setVar('cssFiles', rex_view::getCssFiles()); diff --git a/redaxo/src/core/lib/error_handler.php b/redaxo/src/core/lib/error_handler.php index d704a35ba5..a8be218bec 100644 --- a/redaxo/src/core/lib/error_handler.php +++ b/redaxo/src/core/lib/error_handler.php @@ -3,6 +3,7 @@ use Redaxo\Core\Core; use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Request; use Redaxo\Core\Log\Logger; use Redaxo\Core\Security\BackendLogin; use Redaxo\Core\Security\Login; @@ -236,7 +237,7 @@ private static function renderWhoops($exception) if (rex_server('REQUEST_URI')) { $bugBody = '**Request-Uri:** ' . rex_server('REQUEST_URI') . "\n" . - '**Request-Method:** ' . strtoupper(rex_request::requestMethod()) . "\n" . + '**Request-Method:** ' . strtoupper(Request::requestMethod()) . "\n" . "\n" . $bugBody; } diff --git a/redaxo/src/core/lib/setup/setup.php b/redaxo/src/core/lib/setup/setup.php index cd0cf94626..0fad79c543 100644 --- a/redaxo/src/core/lib/setup/setup.php +++ b/redaxo/src/core/lib/setup/setup.php @@ -8,6 +8,7 @@ use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; use Redaxo\Core\Http\Context; +use Redaxo\Core\Http\Request; use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Formatter; use Redaxo\Core\Util\Type; @@ -179,7 +180,7 @@ public static function checkPhpSecurity() { $security = []; - if (PHP_SAPI !== 'cli' && !rex_request::isHttps()) { + if (PHP_SAPI !== 'cli' && !Request::isHttps()) { $security[] = I18n::msg('setup_security_no_https'); } diff --git a/redaxo/src/core/lib/system_report.php b/redaxo/src/core/lib/system_report.php index 4464314b43..cc50d491dd 100644 --- a/redaxo/src/core/lib/system_report.php +++ b/redaxo/src/core/lib/system_report.php @@ -4,6 +4,7 @@ use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; use Redaxo\Core\Filesystem\Path; +use Redaxo\Core\Http\Request; use Redaxo\Core\Util\Version; class rex_system_report @@ -94,7 +95,7 @@ public function get() $data['Request'] = [ 'Browser' => $this->getBrowser(), 'Protocol' => $_SERVER['SERVER_PROTOCOL'], - 'HTTPS' => rex_request::isHttps(), + 'HTTPS' => Request::isHttps(), ]; } diff --git a/redaxo/src/core/pages/mediapool.php b/redaxo/src/core/pages/mediapool.php index 3a13de6ae7..22150b7a1d 100644 --- a/redaxo/src/core/pages/mediapool.php +++ b/redaxo/src/core/pages/mediapool.php @@ -3,6 +3,7 @@ use Redaxo\Core\Backend\Controller; use Redaxo\Core\Core; use Redaxo\Core\Database\Sql; +use Redaxo\Core\Http\Request; use Redaxo\Core\Translation\I18n; use Redaxo\Core\Util\Str; @@ -97,7 +98,7 @@ $error = ''; } -if (!rex_request::isXmlHttpRequest()) { +if (!Request::isXmlHttpRequest()) { ?> '; + echo "\n" . ' '; } ?> diff --git a/redaxo/src/core/functions/function_structure_rex_url.php b/redaxo/src/core/functions/function_structure_rex_url.php index 57ddf49445..4a6d1e0787 100644 --- a/redaxo/src/core/functions/function_structure_rex_url.php +++ b/redaxo/src/core/functions/function_structure_rex_url.php @@ -2,6 +2,7 @@ use Redaxo\Core\Content\Article; use Redaxo\Core\Filesystem\Url; +use Redaxo\Core\Http\Response; use Redaxo\Core\Language\Language; use Redaxo\Core\Util\Str; @@ -50,5 +51,5 @@ function rex_getUrl(?int $id = null, ?int $clang = null, array $params = []): st */ function rex_redirect(?int $articleId = null, ?int $clang = null, array $params = []): never { - rex_response::sendRedirect(rex_getUrl($articleId, $clang, $params)); + Response::sendRedirect(rex_getUrl($articleId, $clang, $params)); } diff --git a/redaxo/src/core/lib/error_handler.php b/redaxo/src/core/lib/error_handler.php index a8be218bec..c5b5ff7374 100644 --- a/redaxo/src/core/lib/error_handler.php +++ b/redaxo/src/core/lib/error_handler.php @@ -4,6 +4,7 @@ use Redaxo\Core\Filesystem\Path; use Redaxo\Core\Filesystem\Url; use Redaxo\Core\Http\Request; +use Redaxo\Core\Http\Response; use Redaxo\Core\Log\Logger; use Redaxo\Core\Security\BackendLogin; use Redaxo\Core\Security\Login; @@ -77,15 +78,15 @@ public static function handleException($exception) ob_end_clean(); } - $status = rex_response::HTTP_INTERNAL_ERROR; + $status = Response::HTTP_INTERNAL_ERROR; if ($exception instanceof rex_http_exception && $exception->getHttpCode()) { $status = $exception->getHttpCode(); } - rex_response::setStatus($status); + Response::setStatus($status); if (Core::isSetup() || Core::isDebugMode() || !Core::isLiveMode() && BackendLogin::createUser()?->isAdmin()) { [$errPage, $contentType] = self::renderWhoops($exception); - rex_response::sendContent($errPage, $contentType); + Response::sendContent($errPage, $contentType); exit(1); } } catch (Throwable) { @@ -104,7 +105,7 @@ public static function handleException($exception) $errorPage = 'Oooops, an internal error occured!'; } - rex_response::sendContent($errorPage); + Response::sendContent($errorPage); exit(1); } @@ -141,7 +142,7 @@ private static function renderWhoops($exception) ' . Core::getVersion() . ' '; $styles = ' - '; + $mailBody .= ' '; $mailBody .= ''; $mailBody .= ' '; $mailBody .= ' '; diff --git a/src/MediaManager/Effect/ImagePropertiesEffect.php b/src/MediaManager/Effect/ImagePropertiesEffect.php index 89f4ececac..c52ee56d3f 100644 --- a/src/MediaManager/Effect/ImagePropertiesEffect.php +++ b/src/MediaManager/Effect/ImagePropertiesEffect.php @@ -2,9 +2,9 @@ namespace Redaxo\Core\MediaManager\Effect; +use Redaxo\Core\Http\Response; use Redaxo\Core\MediaManager\ManagedMedia; use Redaxo\Core\Translation\I18n; -use rex_response; use function in_array; @@ -92,7 +92,7 @@ public function getParams() 'options' => [self::NO_INTERLACING, 'jpg', 'png', 'gif'], 'attributes' => ['multiple' => true, 'class' => 'selectpicker form-control'], 'suffix' => ' -']]> @@ -13,7 +13,7 @@ var history_article_id = ' . Article::getCurrentId() . '; var history_clang_id = ' . Language::getCurrentId() . '; - var history_ctype_id = ' . rex_request('ctype', 'int', 0) . '; + var history_ctype_id = ' . Request::request('ctype', 'int', 0) . '; var history_article_link = "' . rex_escape($articleLink, 'js') . '"; ']]> @@ -76,15 +76,42 @@ getVar('content2select')]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/.tools/psalm/baseline.xml b/.tools/psalm/baseline.xml index be10f5bff7..69ec2934c8 100644 --- a/.tools/psalm/baseline.xml +++ b/.tools/psalm/baseline.xml @@ -138,6 +138,9 @@ + + + @@ -145,6 +148,7 @@ + ]]> @@ -152,20 +156,69 @@ - + - + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -233,6 +286,7 @@ + @@ -248,15 +302,29 @@ + + + + + + + + + + + + + + @@ -266,23 +334,59 @@ + + + + + + + + + + $addonkey, 'file' => $fileId] + rex_api_install_package_delete::getUrlParams()]]> + $addonkey, 'file' => $fileId] + rex_api_install_package_upload::getUrlParams()]]> + + + + + + + + - + + + + - + + + + + + + + + + + + + + + @@ -294,19 +398,35 @@ + + + + + + + + + + + + + + + getParam('direction')]]> + @@ -326,8 +446,15 @@ + + + getParam('file')]]> + + + + @@ -875,9 +1002,22 @@ + + + + + + + + + + + + + @@ -965,12 +1105,16 @@ + + + + @@ -978,6 +1122,12 @@ + + + + + + @@ -989,7 +1139,7 @@ - + @@ -1078,9 +1228,15 @@ + + + + + + @@ -1230,15 +1386,27 @@ - + - - - + + + + + + + + + + + + + + + @@ -1256,7 +1424,20 @@ + + + + + + + + + + + + + @@ -1270,7 +1451,20 @@ + + + + + + + + + + + + + @@ -1287,6 +1481,13 @@ + + + + + + + @@ -1304,14 +1505,20 @@ + + + + + + @@ -1333,12 +1540,34 @@ getAttribute('id'), 'js')]]> + + + + + + + + + + + + + + + + + + + $effectId]]]> + $typeId]]]> + $typeId]]]> + @@ -1347,8 +1576,19 @@ + + + + + + + + + + + @@ -1356,10 +1596,39 @@ getAttribute('id')]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1373,19 +1642,36 @@ + + + + + + + + + + $typeId]]]> + $typeId]]]> + + + + + + getValue('description'))]]> getValue('name'))]]> @@ -1404,10 +1690,15 @@ + + + + + @@ -1435,10 +1726,12 @@ + + $fileName]]]> $media->getId(), 'rex_file_category' => $rexFileCategory], $argUrl)]]> @@ -1447,6 +1740,11 @@ + + + + + @@ -1458,15 +1756,47 @@ getValue('updatedate')]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1475,8 +1805,13 @@ getPath()]]> + + + + + ''])]]> @@ -1484,9 +1819,14 @@ + + + + + @@ -1500,6 +1840,12 @@ getPath()]]> + + + + + + @@ -1515,15 +1861,34 @@ - + + + + - + + + + + + + + + + + + + + + + + @@ -1531,11 +1896,16 @@ + + + + + getValue('createuser'))]]> getValue('updateuser'))]]> @@ -1546,10 +1916,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1592,6 +2002,10 @@ + + + + @@ -1602,6 +2016,16 @@ + + + + + + + + + + @@ -1615,6 +2039,10 @@ + + + + @@ -1626,7 +2054,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1634,10 +2099,19 @@ + + + + + + + + + @@ -1650,6 +2124,23 @@ + + + + + + + + + + + + + + + + + @@ -1697,6 +2188,12 @@ + + + + + + @@ -1705,8 +2202,14 @@ + + + + + + @@ -1725,6 +2228,8 @@ + + @@ -1736,8 +2241,6 @@ getValue('parent_id')]]> getValue('parent_id')]]> - - @@ -1745,25 +2248,48 @@ - - - + + + + + + + + + + getMessages()]]> + + + + + $sliceId]]]> + + + + + + + + + + + @@ -1775,6 +2301,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -1790,19 +2337,46 @@ getValue('previewmode')]]> + + + + + + + + + $actionId]]]> + + + + + + + + + + + + + + + + + + @@ -1816,14 +2390,6 @@ getValue('name'))]]> getValue('name'))]]> - - - - - - - - @@ -1854,6 +2420,47 @@ getValue('id')]]]> + + + + + + + + + + + + + + + + + + + + + $iactionId]]]> + $moduleId]]]> + Request::request('start', 'int')]]]> + + + + + + + + + + + + + + + + + + @@ -1919,26 +2526,73 @@ + + + + + + + + + + + + + + $templateId]]]> + Request::request('start', 'int')]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1951,12 +2605,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getValue('code'))]]> getValue('code'))]]> @@ -1991,6 +2684,11 @@ + + + + + @@ -1999,11 +2697,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -2018,6 +2740,7 @@ + @@ -2027,7 +2750,12 @@ + + + + + @@ -2035,22 +2763,67 @@ + + + getValue('id')]]> getValue('name')]]> + + $list->getValue('id')] + UserImpersonate::getUrlParams()]]> + + + + + + + + + + + + + + + + + + + + - - $list->getValue('id')] + UserImpersonate::getUrlParams()]]> - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -2058,13 +2831,12 @@ + getValue('id')]]> getValue('name')]]> - - @@ -2168,17 +2940,40 @@ getPackageId()]]> + + + + + + + + + + + + + + + + + + + + + + - + + @@ -2432,31 +3227,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2492,11 +3478,18 @@ + + + + + + event]]> moduleId]]> save]]> + @@ -2510,6 +3503,9 @@ + + vars]]> + @@ -2524,6 +3520,14 @@ + + + + + + + + getTemplate()]]> @@ -3187,15 +4191,35 @@ + + + + + + + + + + + + + + + + + + + + @@ -3350,11 +4374,16 @@ + languageSupport['clang']]]> languageSupport['id']]]> languageSupport['id']]]> + + + + @@ -3806,9 +4835,12 @@ + + + @@ -3899,8 +4931,12 @@ + + + + @@ -4001,6 +5037,8 @@ getValue($name)]]> getValue($name)]]> + + @@ -4011,13 +5049,16 @@ - + + + + @@ -4059,6 +5100,7 @@ + @@ -4165,6 +5207,7 @@ + @@ -4234,6 +5277,8 @@ + + @@ -4242,6 +5287,7 @@ 'secure' => $sessionConfig['secure'] ?? false, 'samesite' => $sessionConfig['samesite'] ?? 'lax', ]]]> + @@ -4250,6 +5296,7 @@ + @@ -4280,10 +5327,18 @@ - + + + + + + + ]]> - - + + + + @@ -4475,6 +5530,25 @@ + + + cursor]]> + + + + cursor]]> + + + + + + + + + cursor]]> + cursor]]> + + @@ -4634,6 +5708,7 @@ + @@ -4669,6 +5744,9 @@ |null]]> + + + @@ -4681,7 +5759,12 @@ columnNames[$columnIndex] ?? $default]]> linkAttributes[$column] ?? $default]]> linkAttributes[$column] ?? $default]]> + getValue($column), true)]]> + getName() . '_msg', 'string'))]]> + getName() . '_msg', 'string'))]]> + getName() . '_warning', 'string'))]]> + getName() . '_warning', 'string'))]]> From 4f4eeaaf31c9e5e9a3a7899791e123071bc06557 Mon Sep 17 00:00:00 2001 From: tbaddade Date: Fri, 17 May 2024 15:23:31 +0200 Subject: [PATCH 22/25] =?UTF-8?q?Test=20Class=20umbenannt=20und=20Namespac?= =?UTF-8?q?e=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Http/RequestTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Http/RequestTest.php b/tests/Http/RequestTest.php index bd21f36d45..951b6484f4 100644 --- a/tests/Http/RequestTest.php +++ b/tests/Http/RequestTest.php @@ -1,11 +1,13 @@ Date: Fri, 17 May 2024 13:24:23 +0000 Subject: [PATCH 23/25] Apply php-cs-fixer changes --- tests/Http/RequestTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Http/RequestTest.php b/tests/Http/RequestTest.php index 951b6484f4..908f0f13e5 100644 --- a/tests/Http/RequestTest.php +++ b/tests/Http/RequestTest.php @@ -1,4 +1,5 @@ Date: Fri, 17 May 2024 15:59:24 +0200 Subject: [PATCH 24/25] return auf self angepasst --- src/Http/Context.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/Context.php b/src/Http/Context.php index d013bbff5c..37978967b9 100644 --- a/src/Http/Context.php +++ b/src/Http/Context.php @@ -95,7 +95,7 @@ public function getHiddenInputFields(array $params = []) /** * Returns a Context instance containing all GET and POST parameters. * - * @return Context + * @return self */ public static function restore() { @@ -106,7 +106,7 @@ public static function restore() /** * Returns a Context instance containing all GET parameters. * - * @return Context + * @return self */ public static function fromGet() { @@ -116,7 +116,7 @@ public static function fromGet() /** * Returns a Context instance containing all POST parameters. * - * @return Context + * @return self */ public static function fromPost() { From 41fc9e20b858c22ae9b545fa4e002901e14ea223 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Sun, 19 May 2024 23:51:54 +0200 Subject: [PATCH 25/25] Update redaxo/psalm-plugin --- .tools/psalm/baseline-taint.xml | 28 - .tools/psalm/baseline.xml | 1196 +------------------------------ composer.json | 2 +- 3 files changed, 40 insertions(+), 1186 deletions(-) diff --git a/.tools/psalm/baseline-taint.xml b/.tools/psalm/baseline-taint.xml index d6e2629180..a8c0471a28 100644 --- a/.tools/psalm/baseline-taint.xml +++ b/.tools/psalm/baseline-taint.xml @@ -76,41 +76,13 @@ getVar('content2select')]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.tools/psalm/baseline.xml b/.tools/psalm/baseline.xml index d3c34514ba..98a5c3c7a1 100644 --- a/.tools/psalm/baseline.xml +++ b/.tools/psalm/baseline.xml @@ -138,9 +138,6 @@ - - - @@ -148,7 +145,6 @@ - ]]> @@ -156,69 +152,20 @@ - - - - - - - - - - - - - - - + - - - - + - - - - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -286,7 +233,6 @@ - @@ -302,29 +248,15 @@ - - - - - - - - - - - - - - @@ -334,59 +266,23 @@ - - - - - - - - - - $addonkey, 'file' => $fileId] + rex_api_install_package_delete::getUrlParams()]]> - $addonkey, 'file' => $fileId] + rex_api_install_package_upload::getUrlParams()]]> - - - - - - - - - - - - + - + - - - - - - - - - - - - - - @@ -398,35 +294,19 @@ - - - - - - - - - - - - - - - getParam('direction')]]> - @@ -446,15 +326,8 @@ - - - getParam('file')]]> - - - - @@ -1002,22 +875,9 @@ - - - - - - - - - - - - - @@ -1105,16 +965,12 @@ - - - - @@ -1122,12 +978,6 @@ - - - - - - @@ -1188,15 +1038,9 @@ - - - - - - @@ -1243,27 +1087,15 @@ - + + + - - - - - - - - + - - - - - - - @@ -1281,20 +1113,7 @@ - - - - - - - - - - - - - @@ -1308,20 +1127,7 @@ - - - - - - - - - - - - - @@ -1338,13 +1144,6 @@ - - - - - - - @@ -1362,20 +1161,14 @@ - - - - - - @@ -1397,34 +1190,12 @@ getAttribute('id'), 'js')]]> - - - - - - - - - - - - - - - - - - - $effectId]]]> - $typeId]]]> - $typeId]]]> - @@ -1433,19 +1204,8 @@ - - - - - - - - - - - @@ -1453,39 +1213,10 @@ getAttribute('id')]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1499,36 +1230,19 @@ - - - - - - - - - - $typeId]]]> - $typeId]]]> - - - - - - getValue('description'))]]> getValue('name'))]]> @@ -1547,15 +1261,10 @@ - - - - - @@ -1583,12 +1292,10 @@ - - $fileName]]]> $media->getId(), 'rex_file_category' => $rexFileCategory], $argUrl)]]> @@ -1597,11 +1304,6 @@ - - - - - @@ -1613,47 +1315,15 @@ getValue('updatedate')]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1662,13 +1332,8 @@ getPath()]]> - - - - - ''])]]> @@ -1676,14 +1341,9 @@ - - - - - @@ -1697,12 +1357,6 @@ getPath()]]> - - - - - - @@ -1718,34 +1372,15 @@ - - - - + - - - - - - - - + - - - - - - - - - @@ -1753,16 +1388,11 @@ - - - - - getValue('createuser'))]]> getValue('updateuser'))]]> @@ -1773,45 +1403,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1859,10 +1449,6 @@ - - - - @@ -1873,16 +1459,6 @@ - - - - - - - - - - @@ -1896,10 +1472,6 @@ - - - - @@ -1911,44 +1483,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1956,19 +1491,10 @@ - - - - - - - - - @@ -1981,23 +1507,6 @@ - - - - - - - - - - - - - - - - - @@ -2045,12 +1554,6 @@ - - - - - - @@ -2059,14 +1562,8 @@ - - - - - - @@ -2085,8 +1582,6 @@ - - @@ -2098,6 +1593,8 @@ getValue('parent_id')]]> getValue('parent_id')]]> + + @@ -2105,48 +1602,25 @@ + + + - - - - - - - - - - getMessages()]]> - - - - - $sliceId]]]> - - - - - - - - - - - @@ -2158,27 +1632,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -2194,46 +1647,19 @@ getValue('previewmode')]]> - - - - - - - - - $actionId]]]> - - - - - - - - - - - - - - - - - - @@ -2247,6 +1673,14 @@ getValue('name'))]]> getValue('name'))]]> + + + + + + + + @@ -2277,47 +1711,6 @@ getValue('id')]]]> - - - - - - - - - - - - - - - - - - - - - $iactionId]]]> - $moduleId]]]> - Request::request('start', 'int')]]]> - - - - - - - - - - - - - - - - - - @@ -2383,73 +1776,26 @@ - - - - - - - - - - - - - - $templateId]]]> - Request::request('start', 'int')]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2462,51 +1808,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getValue('code'))]]> getValue('code'))]]> @@ -2541,11 +1848,6 @@ - - - - - @@ -2554,35 +1856,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2597,7 +1875,6 @@ - @@ -2607,12 +1884,7 @@ - - - - - @@ -2620,67 +1892,22 @@ - - - getValue('id')]]> getValue('name')]]> - - $list->getValue('id')] + UserImpersonate::getUrlParams()]]> - - - - - - - - - - - - - - - - - - - - - - + $list->getValue('id')] + UserImpersonate::getUrlParams()]]> + - - - - - - - - - - - - - - - - - - - - - - + + @@ -2688,12 +1915,13 @@ - getValue('id')]]> getValue('name')]]> + + @@ -2783,22 +2011,10 @@ ]]> - getPackageId()]]> - getPackageId()]]> - getPackageId()]]> - - - - - - - - - - - - - + getPackageId()]]> + getPackageId()]]> + getPackageId()]]> + @@ -2806,21 +2022,10 @@ - - - - - - - - - - - @@ -3075,222 +2280,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3326,18 +2340,11 @@ - - - - - - event]]> moduleId]]> save]]> - @@ -3351,9 +2358,6 @@ - - vars]]> - @@ -3368,14 +2372,6 @@ - - - - - - - - getTemplate()]]> @@ -4039,35 +3035,15 @@ - - - - - - - - - - - - - - - - - - - - @@ -4222,16 +3198,11 @@ - languageSupport['clang']]]> languageSupport['id']]]> languageSupport['id']]]> - - - - @@ -4348,7 +3319,6 @@ getStart()]]> - @@ -4358,7 +3328,6 @@ - @@ -4683,12 +3652,9 @@ - - - @@ -4779,12 +3745,8 @@ - - - - @@ -4885,8 +3847,6 @@ getValue($name)]]> getValue($name)]]> - - @@ -4897,16 +3857,13 @@ + - - - - @@ -4948,7 +3905,6 @@ - @@ -5055,7 +4011,6 @@ - @@ -5238,38 +4193,11 @@ - - - - - - - - $passkeyId, 'user_id' => $userId]]]> - - - - - - - - - - - - - - - - - - - @@ -5278,7 +4206,6 @@ 'secure' => $sessionConfig['secure'] ?? false, 'samesite' => $sessionConfig['samesite'] ?? 'lax', ]]]> - @@ -5287,7 +4214,6 @@ - @@ -5318,18 +4244,10 @@ - - - - - - - - ]]> - - + - + ]]> + @@ -5451,10 +4369,6 @@ $cookieKey]]]> - - - - @@ -5521,25 +4435,6 @@ - - - cursor]]> - - - - cursor]]> - - - - - - - - - cursor]]> - cursor]]> - - @@ -5614,17 +4509,14 @@ - - - @@ -5638,7 +4530,6 @@ - @@ -5699,7 +4590,6 @@ - @@ -5735,9 +4625,6 @@ |null]]> - - - @@ -5750,12 +4637,7 @@ columnNames[$columnIndex] ?? $default]]> linkAttributes[$column] ?? $default]]> linkAttributes[$column] ?? $default]]> - getValue($column), true)]]> - getName() . '_msg', 'string'))]]> - getName() . '_msg', 'string'))]]> - getName() . '_warning', 'string'))]]> - getName() . '_warning', 'string'))]]> diff --git a/composer.json b/composer.json index 7493467ab6..8c31e3bd33 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "psalm/plugin-symfony": "v5.1.0", "rector/rector": "1.0.5", "redaxo/php-cs-fixer-config": "2.10.0", - "redaxo/psalm-plugin": "2.0.0", + "redaxo/psalm-plugin": "2.1.0", "vimeo/psalm": "5.24.0" }, "replace": {