Skip to content

Commit c82b54c

Browse files
sol-loupstrygo
andauthored
Addressing static lint issues (#571)
* Addressing static lint issues * Remove catalog dep * Adding Magento/Customer as a composer dep * Fixing final phpcs issues * Fixing dangling comma (php 7 compat) * PHPSTan issue: method should return array but currently returns void * autoformatting shipper file * bad merge --------- Co-authored-by: Steve Gordon <[email protected]>
1 parent 45a4225 commit c82b54c

File tree

14 files changed

+105
-92
lines changed

14 files changed

+105
-92
lines changed

app/code/Meta/BusinessExtension/Block/Adminhtml/System/Config/ManualDataSyncEmpty.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ class ManualDataSyncEmpty extends Field
3030
*/
3131
protected $_template = 'Meta_BusinessExtension::system/config/manual_data_sync_empty.phtml';
3232

33-
/**
34-
* @param Context $context
35-
* @param array $data
36-
*/
37-
public function __construct(
38-
Context $context,
39-
array $data = []
40-
) {
41-
parent::__construct($context, $data);
42-
}
43-
4433
/**
4534
* Remove scope label
4635
*

app/code/Meta/BusinessExtension/Controller/Adminhtml/Ajax/ReportClientError.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ReportClientError extends AbstractAjax
4444
public function __construct(
4545
Context $context,
4646
JsonFactory $resultJsonFactory,
47-
FBEHelper $fbeHelper,
47+
FBEHelper $fbeHelper
4848
) {
4949
parent::__construct($context, $resultJsonFactory, $fbeHelper);
5050
$this->fbeHelper = $fbeHelper;
@@ -80,5 +80,6 @@ public function executeForJson()
8080
$stackTrace,
8181
$loggingContext,
8282
);
83+
return [];
8384
}
8485
}

app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,8 @@ public function acknowledgeOrders($ordersRootId, array $orderIds)
710710
* Mark order items as shipped
711711
*
712712
* @param mixed $fbOrderId
713-
* @param array $items
714713
* @param string $magentoShipmentId
714+
* @param array $items
715715
* @param array $trackingInfo
716716
* @param array $fulfillmentAddressData
717717
* @return mixed|\Psr\Http\Message\ResponseInterface

app/code/Meta/BusinessExtension/Plugin/LoggingPluginBase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ abstract class LoggingPluginBase
5353
public function __construct(
5454
FBEHelper $fbeHelper,
5555
RequestInterface $request,
56-
StoreRepositoryInterface $storeRepository,
56+
StoreRepositoryInterface $storeRepository
5757
) {
5858
$this->fbeHelper = $fbeHelper;
5959
$this->request = $request;
@@ -74,7 +74,7 @@ public function wrapCallableWithErrorAndImpressionLogging(
7474
string $log_prefix,
7575
$subject,
7676
callable $progress,
77-
...$args,
77+
...$args
7878
) {
7979
return $this->wrapCallableWithLogging(
8080
true, // $should_log_errors
@@ -100,7 +100,7 @@ public function wrapCallableWithErrorLogging(
100100
string $log_prefix,
101101
$subject,
102102
callable $progress,
103-
...$args,
103+
...$args
104104
) {
105105
return $this->wrapCallableWithLogging(
106106
true, // $should_log_errors
@@ -130,7 +130,7 @@ private function wrapCallableWithLogging(
130130
string $log_prefix,
131131
$subject,
132132
callable $progress,
133-
...$args,
133+
...$args
134134
) {
135135
$classname = $this->getClassnameForLogging($subject);
136136
if (!str_starts_with($classname, "Meta\\")) {

app/code/Meta/Catalog/Model/ResourceModel/FacebookCatalogUpdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private function getChildProductLinks(array $parentIds)
216216
/**
217217
* Delete all the product update entries
218218
*
219-
* @param $sku
219+
* @param bool|int|string $sku
220220
* @return void
221221
*/
222222
public function deleteUpdateProductEntries($sku): void

app/code/Meta/Catalog/Setup/Patch/Data/UpdateMetaCatalogSourceAttribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ private function updateAttribute()
6262
{
6363
$connection = $this->moduleDataSetup->getConnection();
6464
$tableName = $this->moduleDataSetup->getTable('eav_attribute');
65+
// phpcs:disable
6566
$oldSourceModel = 'Facebook\BusinessExtension\Model\Config\Source\Product\GoogleProductCategory';
6667
$newSourceModel = \Meta\Catalog\Model\Config\Source\Product\GoogleProductCategory::class;
6768

@@ -93,6 +94,7 @@ private function revertAttributeUpdate()
9394
{
9495
$connection = $this->moduleDataSetup->getConnection();
9596
$tableName = $this->moduleDataSetup->getTable('eav_attribute');
97+
// phpcs:disable
9698
$oldSourceModel = 'Facebook\BusinessExtension\Model\Config\Source\Product\GoogleProductCategory';
9799
$newSourceModel = \Meta\Catalog\Model\Config\Source\Product\GoogleProductCategory::class;
98100
$connection->update(

app/code/Meta/Conversion/view/frontend/templates/pixel/search.phtml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ if ($block->getFacebookPixelID()) {
1010
{
1111
"*": {
1212
"Meta_Conversion/js/metaPixelTracker" : {
13-
"url" : "<?= $block->escapeJs($trackerUrl); ?>",
14-
"payload": <?= json_encode([
15-
"eventName" => $block->getEventToObserveName(),
16-
"searchQuery" => $block->getSearchQuery()
13+
"url" : "<?= $block->escapeHtml($trackerUrl); ?>",
14+
"payload": <?= /* @noEscape */ json_encode([
15+
"eventName" => $block->escapeHtml($block->getEventToObserveName()),
16+
"searchQuery" => $block->escapeHtml($block->getSearchQuery())
1717
]) ?>,
18-
"browserEventData": <?= json_encode([
19-
'fbAgentVersion' => $block->getFacebookAgentVersion(),
20-
'fbPixelId' => $block->getFacebookPixelID(),
21-
'source' => $block->getSource(),
22-
'pluginVersion' => $block->getPluginVersion(),
18+
"browserEventData": <?= /* @noEscape */ json_encode([
19+
'fbAgentVersion' => $block->escapeHtml($block->getFacebookAgentVersion()),
20+
'fbPixelId' => $block->escapeHtml($block->getFacebookPixelID()),
21+
'source' => $block->escapeHtml($block->getSource()),
22+
'pluginVersion' => $block->escapeHtml($block->getPluginVersion()),
2323
'track' => 'track',
2424
'event' => 'Search',
25-
'payload' => ['search_string' => $block->getSearchQuery()]
25+
'payload' => ['search_string' => $block->escapeHtml($block->getSearchQuery())]
2626
]) ?>
2727
}
2828
}

app/code/Meta/Conversion/view/frontend/templates/pixel/view_category.phtml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ if ($block->getFacebookPixelID()) {
1010
{
1111
"*": {
1212
"Meta_Conversion/js/metaPixelTracker" : {
13-
"url" : "<?= $block->escapeJs($trackerUrl); ?>",
14-
"payload": <?= json_encode([
15-
"eventName" => $block->getEventToObserveName(),
16-
"categoryId" => $block->getCategoryId(),
13+
"url" : "<?= $block->escapeHtml($trackerUrl); ?>",
14+
"payload": <?= /* @noEscape */ json_encode([
15+
"eventName" => $block->escapeHtml($block->getEventToObserveName()),
16+
"categoryId" => $block->escapeHtml($block->getCategoryId()),
1717
]) ?>,
18-
"browserEventData": <?= json_encode([
19-
'fbAgentVersion' => $block->getFacebookAgentVersion(),
20-
'fbPixelId' => $block->getFacebookPixelID(),
21-
'source' => $block->getSource(),
22-
'pluginVersion' => $block->getPluginVersion(),
18+
"browserEventData": <?= /* @noEscape */ json_encode([
19+
'fbAgentVersion' => $block->escapeHtml($block->getFacebookAgentVersion()),
20+
'fbPixelId' => $block->escapeHtml($block->getFacebookPixelID()),
21+
'source' => $block->escapeHtml($block->getSource()),
22+
'pluginVersion' => $block->escapeHtml($block->getPluginVersion()),
2323
'track' => 'trackCustom',
2424
'event' => 'ViewCategory',
25-
'payload' => ['category_name' => $block->getCategoryName() ]
25+
'payload' => ['category_name' => $block->escapeHtml($block->getCategoryName()) ]
2626
]) ?>
2727
}
2828
}

app/code/Meta/Sales/Cron/SyncOrders.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public function __construct(
6363
SystemConfig $systemConfig,
6464
CommerceHelper $commerceHelper,
6565
FBEHelper $fbeHelper
66-
)
67-
{
66+
) {
6867
$this->systemConfig = $systemConfig;
6968
$this->commerceHelper = $commerceHelper;
7069
$this->storeManager = $storeManager;

app/code/Meta/Sales/Helper/OrderHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class OrderHelper
3838
private $facebookOrderFactory;
3939

4040
/**
41+
* Constructor
42+
*
4143
* @param OrderExtensionFactory $orderExtensionFactory
4244
* @param FacebookOrderInterfaceFactory $facebookOrderFactory
4345
*/

0 commit comments

Comments
 (0)