From cea023442b85770a2dab98325b8c8a4ca18bba8f Mon Sep 17 00:00:00 2001 From: "ivan.hrytsai" Date: Fri, 13 Jun 2025 11:55:19 +0300 Subject: [PATCH 1/5] test --- Block/Adminhtml/Grid/Column/Author.php | 2 +- Block/Adminhtml/Grid/Column/Categories.php | 2 +- Block/Adminhtml/Grid/Column/Statuses.php | 4 +- Block/Adminhtml/Post/Helper/Form/Gallery.php | 4 +- .../Post/Helper/Form/Gallery/Content.php | 4 +- .../System/Config/Form/CheckEnableInfo.php | 4 +- Block/Adminhtml/System/Config/Form/Info.php | 4 +- .../Config/Form/PermalinkSettingsMessage.php | 2 +- .../System/Config/Form/SitemapInfo.php | 2 +- .../System/Config/Form/UpdateInfo.php | 2 +- Block/Archive/Archive.php | 4 +- Block/Archive/PostList.php | 2 +- Block/Catalog/Product/RelatedPosts.php | 2 +- Block/Category/PostLinks.php | 4 +- Block/Category/PostList.php | 2 +- Block/Category/SubCategoryLinks.php | 2 +- Block/Index.php | 2 +- Block/Infortis/UltraMegamenu/Topmenu.php | 2 +- Block/Post/Info.php | 10 ++--- Block/Post/PostList.php | 2 +- Block/Post/PostList/Toolbar.php | 8 ++-- Block/Post/PostList/Toolbar/Pager.php | 8 ++-- Block/Post/View.php | 2 +- Block/Post/View/Comments.php | 2 +- Block/Post/View/Comments/Facebook.php | 2 +- Block/Post/View/Comments/Magefan.php | 2 +- Block/Post/View/NextPrev.php | 2 +- Block/Post/View/RelatedPosts.php | 2 +- Block/Post/View/RelatedProducts.php | 6 +-- Block/Post/View/Richsnippets.php | 2 +- Block/Rss/Feed.php | 2 +- Block/Search/PostList.php | 4 +- Block/Sidebar/Archive.php | 4 +- Block/Sidebar/Categories.php | 2 +- Block/Sidebar/Featured.php | 4 +- Block/Sidebar/Popular.php | 4 +- Block/Sidebar/PostRelatedProducts.php | 2 +- Block/Sidebar/Recent.php | 2 +- Block/Sidebar/Search.php | 2 +- Block/Sidebar/TagClaud.php | 2 +- Block/Sidebar/Widget.php | 2 +- Block/Smartwave/Megamenu/Topmenu.php | 2 +- Block/Social/AddThis.php | 2 +- Block/Widget/Featured.php | 2 +- Block/Widget/PostList.php | 6 +-- Controller/Adminhtml/Import/Form.php | 2 +- Controller/Adminhtml/Import/Index.php | 2 +- Controller/Adminhtml/Import/Run.php | 2 +- Controller/Adminhtml/Post/Preview.php | 2 +- Controller/Adminhtml/Post/Save.php | 2 +- Controller/Post/Viewscount.php | 2 +- Controller/Router.php | 4 +- Cron/ReSaveExistingPosts.php | 2 +- Helper/Data.php | 4 +- Helper/Image.php | 8 ++-- Model/AbstractManagement.php | 2 +- Model/Author.php | 8 ++-- Model/AuthorRepository.php | 2 +- Model/Category.php | 18 ++++---- Model/CategoryRepository.php | 2 +- Model/Comment.php | 12 +++--- Model/Comment/Notification.php | 2 +- Model/CommentRepository.php | 2 +- Model/Config.php | 16 +++---- Model/Config/Source/ArchiveGroupBy.php | 2 +- Model/Config/Source/Author.php | 2 +- Model/Config/Source/AuthorType.php | 2 +- Model/Config/Source/BlogPages.php | 2 +- Model/Config/Source/Category.php | 4 +- Model/Config/Source/CategoryDisplayMode.php | 2 +- Model/Config/Source/CategoryPath.php | 5 ++- Model/Config/Source/CategoryTree.php | 5 ++- Model/Config/Source/CommentStatus.php | 2 +- Model/Config/Source/CommetType.php | 2 +- Model/Config/Source/DisplayMode.php | 2 +- Model/Config/Source/ImageSizeOptions.php | 2 +- Model/Config/Source/LazyLoad.php | 2 +- Model/Config/Source/PageLayout.php | 2 +- Model/Config/Source/PagePaginationType.php | 2 +- Model/Config/Source/PermalinkType.php | 2 +- Model/Config/Source/PostsSortBy.php | 2 +- .../Source/ReadingProgressBarPosition.php | 2 +- Model/Config/Source/SocialNetworks.php | 2 +- Model/Config/Source/Tag.php | 2 +- Model/Image.php | 2 +- Model/Import/Aw.php | 2 +- Model/Import/Aw2.php | 2 +- Model/Import/Mageplaza.php | 2 +- Model/Import/Mageplaza1.php | 6 +-- Model/Import/Mirasvit.php | 4 +- Model/Import/Wordpress.php | 4 +- Model/NoSlashUrlRedirect.php | 2 +- Model/Post.php | 42 +++++++++---------- Model/PostRepository.php | 2 +- Model/PreviewUrl.php | 2 +- Model/ResourceModel/Category.php | 8 ++-- Model/ResourceModel/Category/Collection.php | 6 +-- Model/ResourceModel/Comment.php | 2 +- Model/ResourceModel/Comment/Collection.php | 4 +- .../ResourceModel/Comment/Collection/Grid.php | 2 +- .../ResourceModel/PageIdentifierGenerator.php | 4 +- Model/ResourceModel/Post.php | 12 +++--- Model/ResourceModel/Post/Collection.php | 16 +++---- Model/ResourceModel/Tag.php | 10 ++--- Model/ResourceModel/Tag/Collection.php | 2 +- Model/ShortContentExtractor.php | 2 +- Model/SlashUrlRedirect.php | 2 +- Model/Tag.php | 12 +++--- Model/Tag/AutocompleteData.php | 2 +- Model/TagRepository.php | 2 +- Model/Url.php | 12 +++--- Model/UrlResolver.php | 6 +-- Observer/InvalidateCache.php | 2 +- Observer/LayoutGenerateBlocksAfter.php | 2 +- Observer/LayoutLoadBeforeObserver.php | 2 +- ...eBlockHtmlTopmenuBethtmlBeforeObserver.php | 2 +- ...thFrontendBlogActionControllerObserver.php | 2 +- Setup/Patch/Data/CreateSamplePost.php | 2 +- Setup/Patch/Data/TagInStore.php | 2 +- Setup/Patch/Data/UpdatePostCommentsCount.php | 2 +- .../Category/Form/CategoryDataProvider.php | 2 +- .../Comment/Form/CommentDataProvider.php | 2 +- .../Post/Form/PostDataProvider.php | 2 +- .../Post/Related/ProductDataProvider.php | 6 +-- Ui/DataProvider/Tag/Form/TagDataProvider.php | 2 +- ViewModel/Style.php | 2 +- 126 files changed, 247 insertions(+), 241 deletions(-) diff --git a/Block/Adminhtml/Grid/Column/Author.php b/Block/Adminhtml/Grid/Column/Author.php index 5389a37b..229b6e0a 100755 --- a/Block/Adminhtml/Grid/Column/Author.php +++ b/Block/Adminhtml/Grid/Column/Author.php @@ -16,7 +16,7 @@ class Author extends \Magento\Backend\Block\Widget\Grid\Column /** * @return void */ - public function _construct() + public function _construct(): void { parent::_construct(); $this->_rendererTypes['author'] = \Magefan\Blog\Block\Adminhtml\Grid\Column\Render\Author::class; diff --git a/Block/Adminhtml/Grid/Column/Categories.php b/Block/Adminhtml/Grid/Column/Categories.php index d61aa0fd..8b3ad9f3 100755 --- a/Block/Adminhtml/Grid/Column/Categories.php +++ b/Block/Adminhtml/Grid/Column/Categories.php @@ -16,7 +16,7 @@ class Categories extends \Magento\Backend\Block\Widget\Grid\Column /** * @return void */ - public function _construct() + public function _construct(): void { parent::_construct(); $this->_rendererTypes['category'] = \Magefan\Blog\Block\Adminhtml\Grid\Column\Render\Category::class; diff --git a/Block/Adminhtml/Grid/Column/Statuses.php b/Block/Adminhtml/Grid/Column/Statuses.php index 6a891d92..dafc7988 100755 --- a/Block/Adminhtml/Grid/Column/Statuses.php +++ b/Block/Adminhtml/Grid/Column/Statuses.php @@ -18,7 +18,7 @@ class Statuses extends \Magento\Backend\Block\Widget\Grid\Column * * @return array */ - public function getFrameCallback() + public function getFrameCallback(): array { return [$this, 'decorateStatus']; } @@ -32,7 +32,7 @@ public function getFrameCallback() * @param bool $isExport * @return string */ - public function decorateStatus($value, $row, $column, $isExport) + public function decorateStatus(string $value, $row, $column, $isExport): string { if ($row->getIsActive() || $row->getStatus()) { if ($row->getStatus() == 2) { diff --git a/Block/Adminhtml/Post/Helper/Form/Gallery.php b/Block/Adminhtml/Post/Helper/Form/Gallery.php index f221de35..b0e5b722 100644 --- a/Block/Adminhtml/Post/Helper/Form/Gallery.php +++ b/Block/Adminhtml/Post/Helper/Form/Gallery.php @@ -68,7 +68,7 @@ public function __construct( \Magento\Framework\View\Element\Context $context, Registry $registry, \Magento\Framework\Data\Form $form, - $data = [] + array $data = [] ) { $this->registry = $registry; $this->form = $form; @@ -88,7 +88,7 @@ public function getElementHtml() * * @return array|null */ - public function getImages() + public function getImages(): array { $result = []; $gallery = $this->registry->registry('current_model')->getGalleryImages(); diff --git a/Block/Adminhtml/Post/Helper/Form/Gallery/Content.php b/Block/Adminhtml/Post/Helper/Form/Gallery/Content.php index 94c770b4..aabdfd8a 100644 --- a/Block/Adminhtml/Post/Helper/Form/Gallery/Content.php +++ b/Block/Adminhtml/Post/Helper/Form/Gallery/Content.php @@ -115,7 +115,7 @@ public function getUploaderHtml() /** * @return string */ - public function getJsObjectName() + public function getJsObjectName(): string { return $this->getHtmlId() . 'JsObject'; } @@ -160,7 +160,7 @@ public function getImagesJson() private function sortImagesByPosition($images) { if (is_array($images)) { - usort($images, function ($imageA, $imageB) { + usort($images, function (array $imageA, array $imageB): int { return ($imageA['position'] < $imageB['position']) ? -1 : 1; }); } diff --git a/Block/Adminhtml/System/Config/Form/CheckEnableInfo.php b/Block/Adminhtml/System/Config/Form/CheckEnableInfo.php index 9882c0d4..cd79f2fb 100644 --- a/Block/Adminhtml/System/Config/Form/CheckEnableInfo.php +++ b/Block/Adminhtml/System/Config/Form/CheckEnableInfo.php @@ -67,7 +67,7 @@ public function __construct( /** * @return bool */ - public function isEnabled() + public function isEnabled(): bool { foreach ($this->_storeManager->getWebsites() as $website) { foreach ($website->getGroups() as $group) { @@ -90,7 +90,7 @@ public function isEnabled() /** * @return bool */ - public function isKeyMissing() + public function isKeyMissing(): bool { $section = ObjectManager::getInstance()->create(Section::class, ['name' => 'mfblog']); return !$this->config->getConfig(self::XML_PATH_KEY) diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index 834defc8..5021d5c7 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -19,7 +19,7 @@ class Info extends \Magefan\Community\Block\Adminhtml\System\Config\Form\Info * Return extension url * @return string */ - protected function getModuleUrl() + protected function getModuleUrl(): string { return 'https://mage' . 'fan.com/magento2-blog-extension'; } @@ -28,7 +28,7 @@ protected function getModuleUrl() * Return extension title * @return string */ - protected function getModuleTitle() + protected function getModuleTitle(): string { return 'Blog Extension'; } diff --git a/Block/Adminhtml/System/Config/Form/PermalinkSettingsMessage.php b/Block/Adminhtml/System/Config/Form/PermalinkSettingsMessage.php index 2b413358..28371cae 100644 --- a/Block/Adminhtml/System/Config/Form/PermalinkSettingsMessage.php +++ b/Block/Adminhtml/System/Config/Form/PermalinkSettingsMessage.php @@ -13,7 +13,7 @@ class PermalinkSettingsMessage extends \Magefan\Community\Block\Adminhtml\System * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) + public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element): string { $html = '