Skip to content

Commit

Permalink
Merge pull request magento#386 from magento-gl/AC-13306
Browse files Browse the repository at this point in the history
AC-13306::Adobe Commerce 2.4.8 core code is compatible with PHP 8.4
  • Loading branch information
pawan-adobe-security authored Jan 14, 2025
2 parents 1a52ef4 + f9db5d1 commit 7c27e93
Show file tree
Hide file tree
Showing 26 changed files with 97 additions and 98 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AwsS3PageBuilder/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Aws S3 Page Builder module",
"require": {
"magento/framework": "*",
"php": "~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0||~8.4.0"
},
"suggest": {
"magento/module-page-builder": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogPageBuilderAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/module-page-builder-analytics": "*",
"magento/module-catalog": "*",
"magento/framework": "*",
"php": "~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0||~8.4.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CmsPageBuilderAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/module-page-builder-analytics": "*",
"magento/module-cms": "*",
"magento/framework": "*",
"php": "~8.2.0||~8.3.0"
"php": "~8.2.0||~8.3.0||~8.4.0"
},
"type": "magento2-module",
"license": [
Expand Down
11 changes: 3 additions & 8 deletions app/code/Magento/PageBuilder/Block/Adminhtml/Stage/Render.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2019 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand All @@ -15,11 +15,6 @@
use Magento\PageBuilder\Model\Stage\Config;
use Magento\Framework\Serialize\Serializer\Json;

/**
* Class Render
*
* @api
*/
class Render extends Template
{
/**
Expand Down Expand Up @@ -56,7 +51,7 @@ public function __construct(
Config $config,
Json $json,
array $data = [],
Minification $minification = null
?Minification $minification = null
) {
parent::__construct($context, $data);
$this->fileManager = $fileManager;
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/PageBuilder/Block/WysiwygSetup.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2018 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand Down Expand Up @@ -49,7 +49,7 @@ public function __construct(
Context $context,
ConfigInterface $config,
array $data = [],
FrontendInterface $cache = null,
?FrontendInterface $cache = null,
?RandomKey $sessionRandomKey = null
) {
$this->config = $config;
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/PageBuilder/Component/Form/Element/Wysiwyg.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -70,10 +70,10 @@ public function __construct(
array $components = [],
array $data = [],
array $config = [],
PageBuilderConfig $pageBuilderConfig = null,
?PageBuilderConfig $pageBuilderConfig = null,
bool $overrideSnapshot = false,
Repository $assetRepo = null,
AuthorizationInterface $authorization = null
?Repository $assetRepo = null,
?AuthorizationInterface $authorization = null
) {
$this->assetRepo = $assetRepo ?: ObjectManager::getInstance()->get(Repository::class);
$this->authorization = $authorization ?: ObjectManager::getInstance()->get(AuthorizationInterface::class);
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/PageBuilder/Component/Form/HtmlCode.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2019 Adobe
* All Rights Reserved.
*/

namespace Magento\PageBuilder\Component\Form;
Expand All @@ -19,7 +19,7 @@
*/
class HtmlCode extends \Magento\Ui\Component\Form\Field
{
const HTML_ID_PLACEHOLDER = 'HTML_ID_PLACEHOLDER';
public const HTML_ID_PLACEHOLDER = 'HTML_ID_PLACEHOLDER';

/**
* @var BackendUrlInterface
Expand Down Expand Up @@ -63,7 +63,7 @@ public function __construct(
BackendUrlInterface $backendUrl,
Images $imagesHelper,
VariableConfig $variableConfig,
OpenDialogUrl $openDialogUrl = null,
?OpenDialogUrl $openDialogUrl = null,
$currentTreePath = 'wysiwyg',
$components = [],
array $data = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/
namespace Magento\PageBuilder\Controller\Adminhtml\ContentType\Image;

Expand All @@ -17,9 +17,9 @@
*/
class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface
{
const UPLOAD_DIR = 'wysiwyg';
public const UPLOAD_DIR = 'wysiwyg';

const ADMIN_RESOURCE = 'Magento_Backend::content';
public const ADMIN_RESOURCE = 'Magento_Backend::content';

/**
* @var \Magento\Framework\Filesystem\DirectoryList
Expand Down Expand Up @@ -71,7 +71,7 @@ public function __construct(
\Magento\Framework\File\UploaderFactory $uploaderFactory,
\Magento\Framework\Filesystem\DirectoryList $directoryList,
\Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages,
Filesystem $filesystem = null
?Filesystem $filesystem = null
) {
parent::__construct($context);
$this->resultJsonFactory = $resultJsonFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand All @@ -20,6 +20,7 @@
* @deprecated use \Magento\PageBuilder\Controller\Adminhtml\Stage\Preview
*
* @api
* @see MC-16152
*/
class Preview extends \Magento\Framework\App\Action\Action implements HttpPostActionInterface
{
Expand All @@ -43,7 +44,7 @@ class Preview extends \Magento\Framework\App\Action\Action implements HttpPostAc
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\PageBuilder\Model\Stage\RendererPool $rendererPool,
\Magento\Backend\Model\Auth $auth = null
?\Magento\Backend\Model\Auth $auth = null
) {
parent::__construct($context);

Expand All @@ -70,7 +71,7 @@ public function execute()

return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result);
}

// @phpstan-ignore-next-line
$this->_forward('noroute');
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2019 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand Down Expand Up @@ -43,9 +43,9 @@ class SimpleOption implements OptionInterface
*/
public function __construct(
string $label,
string $sortDirection = null,
string $attributeField = null,
string $secondarySortDirection = null
?string $sortDirection = null,
?string $attributeField = null,
?string $secondarySortDirection = null
) {
$this->label = $label;
$this->sortDirection = $sortDirection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2020 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -38,7 +38,7 @@ public function createDocumentFragment(): DocumentFragmentInterface;
* @param string $value [optional]
* @return ElementInterface
*/
public function createElement(string $name, string $value = null);
public function createElement(string $name, ?string $value = null);

/**
* Returns the first element matching the specified selector.
Expand All @@ -62,7 +62,7 @@ public function querySelectorAll(string $selector): HtmlCollectionInterface;
* @param DOMNode|null $node
* @return string
*/
public function saveHTML(DOMNode $node = null): string;
public function saveHTML(?DOMNode $node = null): string;

/**
* Closes the stream and any underlying resources.
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/PageBuilder/Model/Dom/Document.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2020 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -73,7 +73,7 @@ public function createDocumentFragment(): DocumentFragmentInterface
/**
* @inheritDoc
*/
public function createElement(string $name, string $value = null): ElementInterface
public function createElement(string $name, ?string $value = null): ElementInterface
{
return $this->objectManager->create(
ElementInterface::class,
Expand Down Expand Up @@ -106,7 +106,7 @@ public function querySelectorAll(string $selector): HtmlCollectionInterface
/**
* @inheritDoc
*/
public function saveHTML(DOMNode $node = null): string
public function saveHTML(?DOMNode $node = null): string
{
return $this->document->saveHTML($node);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2019 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand Down Expand Up @@ -62,7 +62,7 @@ public function __construct(
$resourceModel,
$model = Document::class,
$connection = null,
AbstractDb $resource = null
?AbstractDb $resource = null
) {
$this->resourceModel = $resourceModel;
$this->model = $model;
Expand Down Expand Up @@ -128,7 +128,7 @@ public function getSearchCriteria()
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function setSearchCriteria(SearchCriteriaInterface $searchCriteria = null)
public function setSearchCriteria(?SearchCriteriaInterface $searchCriteria = null)
{
return $this;
}
Expand Down Expand Up @@ -162,7 +162,7 @@ public function setTotalCount($totalCount)
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function setItems(array $items = null)
public function setItems(?array $items = null)
{
return $this;
}
Expand Down
30 changes: 15 additions & 15 deletions app/code/Magento/PageBuilder/Model/Stage/Config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand All @@ -24,17 +24,17 @@
*/
class Config
{
const DEFAULT_PREVIEW_COMPONENT = 'Magento_PageBuilder/js/content-type/preview';
const DEFAULT_MASTER_COMPONENT = 'Magento_PageBuilder/js/content-type/master';
public const DEFAULT_PREVIEW_COMPONENT = 'Magento_PageBuilder/js/content-type/preview';
public const DEFAULT_MASTER_COMPONENT = 'Magento_PageBuilder/js/content-type/master';

const XML_PATH_COLUMN_GRID_DEFAULT = 'cms/pagebuilder/column_grid_default';
const XML_PATH_COLUMN_GRID_MAX = 'cms/pagebuilder/column_grid_max';
public const XML_PATH_COLUMN_GRID_DEFAULT = 'cms/pagebuilder/column_grid_default';
public const XML_PATH_COLUMN_GRID_MAX = 'cms/pagebuilder/column_grid_max';

const ROOT_CONTAINER_NAME = 'root-container';
public const ROOT_CONTAINER_NAME = 'root-container';

const TEMPLATE_DELETE_RESOURCE = 'Magento_PageBuilder::template_delete';
const TEMPLATE_SAVE_RESOURCE = 'Magento_PageBuilder::template_save';
const TEMPLATE_APPLY_RESOURCE = 'Magento_PageBuilder::template_apply';
public const TEMPLATE_DELETE_RESOURCE = 'Magento_PageBuilder::template_delete';
public const TEMPLATE_SAVE_RESOURCE = 'Magento_PageBuilder::template_save';
public const TEMPLATE_APPLY_RESOURCE = 'Magento_PageBuilder::template_apply';

private const CONTENT_TYPE_CACHE_ID = 'CONTENT_TYPE';
private const TINY_MCE_CONFIG_CACHE_ID = 'TINY_MCE_CONFIG';
Expand Down Expand Up @@ -158,11 +158,11 @@ public function __construct(
\Magento\PageBuilder\Model\WidgetInitializerConfig $widgetInitializerConfig,
array $rootContainerConfig = [],
array $data = [],
\Magento\Widget\Model\Widget\Config $widgetConfig = null,
\Magento\Variable\Model\Variable\Config $variableConfig = null,
AuthorizationInterface $authorization = null,
FrontendInterface $cache = null,
Json $serializer = null,
?\Magento\Widget\Model\Widget\Config $widgetConfig = null,
?\Magento\Variable\Model\Variable\Config $variableConfig = null,
?AuthorizationInterface $authorization = null,
?FrontendInterface $cache = null,
?Json $serializer = null,
?RandomKey $sessionRandomKey = null
) {
$this->config = $config;
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/PageBuilder/Model/Stage/Renderer/Block.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2018 Adobe
* All Rights Reserved.
*/

declare(strict_types=1);
Expand Down Expand Up @@ -46,7 +46,7 @@ public function __construct(
\Magento\PageBuilder\Model\Config $config,
\Magento\Framework\View\Element\BlockFactory $blockFactory,
ResultFactory $resultFactory,
Template $templateFilter = null
?Template $templateFilter = null
) {
$this->config = $config;
$this->blockFactory = $blockFactory;
Expand Down
Loading

0 comments on commit 7c27e93

Please sign in to comment.