Skip to content

Commit c36a8b4

Browse files
committed
Code style changes
1 parent 9f907b7 commit c36a8b4

File tree

23 files changed

+36
-41
lines changed

23 files changed

+36
-41
lines changed

Block/Adminhtml/Post.php

-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ protected function _prepareLayout()
4444

4545
return parent::_prepareLayout();
4646
}
47-
4847
}

Block/Adminhtml/System/Config/Form/UpdateInfo.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ public function getLatestVersion()
112112
throw new \Exception('Empty response');
113113
}
114114
$this->latestVersion = $encodedData[self::MODULE_NAME];
115-
116115
} catch (\Exception $e) {
117116
$this->latestVersion = false;
118117
}
@@ -128,5 +127,4 @@ public function needToUpdate()
128127
{
129128
return (version_compare($this->getCurrentVersion(), $this->getLatestVersion()) < 0);
130129
}
131-
132-
}
130+
}

Block/Adminhtml/Tag.php

-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ protected function _prepareLayout()
4444

4545
return parent::_prepareLayout();
4646
}
47-
4847
}

Block/Category/PostList.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
namespace Magefan\Blog\Block\Category;
10+
1011
use Magento\Framework\Api\SortOrder;
1112
use Magefan\Blog\Model\Config\Source\CategoryDisplayMode;
1213

@@ -34,7 +35,8 @@ protected function _preparePostCollection()
3435
*
3536
* @return string
3637
*/
37-
public function getCollectionOrderField(){
38+
public function getCollectionOrderField()
39+
{
3840
if ($this->getCategory()->getData('posts_sort_by')) {
3941
return self::POSTS_SORT_FIELD_BY_POSITION;
4042
}

Block/Index.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ protected function _preparePostCollection()
6161
}
6262

6363
/**
64-
* Retrieve collection order field
65-
*
66-
* @return string
67-
*/
68-
public function getCollectionOrderField(){
64+
* Retrieve collection order field
65+
*
66+
* @return string
67+
*/
68+
public function getCollectionOrderField()
69+
{
6970
$postsSortBy = $this->_scopeConfig->getValue(
7071
\Magefan\Blog\Helper\Config::XML_PATH_HOMEPAGE_POSTS_SORT_BY,
7172
ScopeInterface::SCOPE_STORE

Block/Post/PostList/AbstractList.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Magento\Store\Model\ScopeInterface;
1212
use Magento\Framework\Api\SortOrder;
13+
1314
/**
1415
* Abstract blog post list block
1516
*/
@@ -95,7 +96,8 @@ protected function _preparePostCollection()
9596
*
9697
* @return string
9798
*/
98-
public function getCollectionOrderField() {
99+
public function getCollectionOrderField()
100+
{
99101
return self::POSTS_SORT_FIELD_BY_PUBLISH_TIME;
100102
}
101103

@@ -104,7 +106,8 @@ public function getCollectionOrderField() {
104106
*
105107
* @return string
106108
*/
107-
public function getCollectionOrderDirection() {
109+
public function getCollectionOrderDirection()
110+
{
108111
return SortOrder::SORT_DESC;
109112
}
110113

@@ -144,7 +147,8 @@ protected function _toHtml()
144147
*
145148
* @return array
146149
*/
147-
public function getIdentities() {
150+
public function getIdentities()
151+
{
148152
$identities = [];
149153
foreach ($this->getPostCollection() as $item) {
150154
$identities = array_merge($identities, $item->getIdentities());

Block/Post/View/RelatedProducts.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ public function getPost()
127127
}
128128

129129
/**
130-
* Return identifiers for produced content
131-
*
132-
* @return array
133-
*/
130+
* Return identifiers for produced content
131+
*
132+
* @return array
133+
*/
134134
public function getIdentities()
135135
{
136136
$identities = [];
@@ -140,5 +140,4 @@ public function getIdentities()
140140

141141
return $identities;
142142
}
143-
144143
}

Block/Sidebar/Categories.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public function maxDepth()
103103
*
104104
* @return array
105105
*/
106-
public function getIdentities() {
106+
public function getIdentities()
107+
{
107108
$identities = [];
108109
foreach ($this->getGroupedChilds() as $item) {
109110
$identities = array_merge($identities, $item->getIdentities());

Block/Sidebar/Custom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magefan\Blog\Block\Sidebar;
1010

1111
use \Magento\Store\Model\ScopeInterface;
12+
1213
/**
1314
* Blog sidebar custom block
1415
*/
@@ -51,7 +52,6 @@ public function getContent()
5152
{
5253
$key = 'content';
5354
if (!$this->hasData($key)) {
54-
5555
$content = $this->_scopeConfig->getValue('mfblog/sidebar/'.$this->_widgetKey.'/html', ScopeInterface::SCOPE_STORE);
5656
$content = $this->filterProvider->getPageFilter()->filter(
5757
$content

Block/Sidebar/CustomTwo.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magefan\Blog\Block\Sidebar;
1010

1111
use \Magento\Store\Model\ScopeInterface;
12+
1213
/**
1314
* Blog sidebar custom block
1415
*/

Block/Sidebar/Featured.php

-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ protected function getPostIdsConfigValue()
4444
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
4545
);
4646
}
47-
4847
}

Block/Sidebar/Recent.php

-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ protected function _preparePostCollection()
4444
parent::_preparePostCollection();
4545
$this->_postCollection->addRecentFilter();
4646
}
47-
4847
}

Block/Sidebar/Rss.php

-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ class Rss extends \Magento\Framework\View\Element\Template
2525
* @var array
2626
*/
2727
protected $_months;
28-
2928
}

Block/Sidebar/TagClaud.php

-1
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,4 @@ public function getTagClass($tag)
126126
}
127127
return 'largest';
128128
}
129-
130129
}

Block/Tag/Info.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
class Info extends \Magefan\Blog\Block\Tag\AbstractTag
1515
{
1616

17-
}
17+
}

Block/Widget/Recent.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ protected function _preparePostCollection()
106106

107107
if ($from = $this->getData('from')) {
108108
$this->_postCollection
109-
->addFieldToFilter('publish_time', array('gteq' => $from . " 00:00:00"));
109+
->addFieldToFilter('publish_time', ['gteq' => $from . " 00:00:00"]);
110110
}
111111

112112
if ($to = $this->getData('to')) {
113113
$this->_postCollection
114-
->addFieldToFilter('publish_time', array('lteq' => $to . " 00:00:00"));
114+
->addFieldToFilter('publish_time', ['lteq' => $to . " 00:00:00"]);
115115
}
116116
}
117117

Controller/Adminhtml/Tag/Save.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class Save extends \Magefan\Blog\Controller\Adminhtml\Tag
1515
{
16-
/**
16+
/**
1717
* Filter request params
1818
* @param array $data
1919
* @return array

Controller/Router.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function __construct(
110110
\Magefan\Blog\Model\TagFactory $tagFactory,
111111
\Magento\Store\Model\StoreManagerInterface $storeManager,
112112
\Magento\Framework\App\ResponseInterface $response
113-
)
114-
{
113+
) {
114+
115115
$this->actionFactory = $actionFactory;
116116
$this->_eventManager = $eventManager;
117117
$this->_url = $url;

Model/Config/Source/WidgetTag.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@
1212
* Used in recent post widget
1313
*
1414
*/
15-
class WidgetTag extends Tag
15+
class WidgetTag extends Tag
1616
{
1717
/**
1818
* Options getter
1919
*
2020
* @return array
2121
*/
2222
public function toOptionArray()
23-
{
23+
{
2424
if ($this->options === null) {
2525
parent::toOptionArray();
2626
array_unshift($this->options, ['label' => __('Please select'), 'value' => 0]);
2727
}
2828

2929
return $this->options;
3030
}
31-
3231
}

Model/Post.php

-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ public function getShortFilteredContent($len = null, $endСharacters = null)
425425
{
426426
$key = 'short_filtered_content' . $len;
427427
if (!$this->hasData($key)) {
428-
429428
if ($this->getShortContent()) {
430429
$content = $this->filterProvider->getPageFilter()->filter(
431430
$this->getShortContent()
@@ -448,7 +447,6 @@ public function getShortFilteredContent($len = null, $endСharacters = null)
448447
if ($len) {
449448
$content = mb_substr($content, 0, $len);
450449
try {
451-
452450
$previousLoaderState = libxml_disable_entity_loader(true);
453451
$previousErrorState = libxml_use_internal_errors(true);
454452
$dom = new \DOMDocument();

Model/ResourceModel/Post/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function addStoreFilter($store, $withAdmin = true)
137137
*/
138138
public function addRecentFilter()
139139
{
140-
return $this->addFieldToFilter('include_in_recent', 1);
140+
return $this->addFieldToFilter('include_in_recent', 1);
141141
}
142142

143143
/**

Model/Tag.php

-1
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,4 @@ public function getIdentifier()
187187
{
188188
return (string)$this->getData('identifier');
189189
}
190-
191190
}

Plugin/Magento/Sitemap/SitemapPlugin.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function __construct(
6161
public function afterGenerateXml(Sitemap $sitemap, $result)
6262
{
6363
if (!method_exists($sitemap, 'collectSitemapItems')) {
64-
6564
$sitemapId = $sitemap->getId() ?: 0;
6665
if (in_array($sitemapId, $this->generated)) {
6766
return $result;
@@ -78,7 +77,6 @@ public function afterGenerateXml(Sitemap $sitemap, $result)
7877
);
7978

8079
$blogSitemap->generateXml();
81-
8280
}
8381

8482
return $result;
@@ -89,7 +87,8 @@ public function afterGenerateXml(Sitemap $sitemap, $result)
8987
* @param $result
9088
* @return mixed
9189
*/
92-
public function afterCollectSitemapItems(Sitemap $sitemap, $result) {
90+
public function afterCollectSitemapItems(Sitemap $sitemap, $result)
91+
{
9392

9493
$storeId = $sitemap->getStoreId();
9594

0 commit comments

Comments
 (0)