Skip to content

Commit e07b7da

Browse files
committed
Static Tests
1 parent 8580a39 commit e07b7da

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ public function getOrderTotal(): ?float
400400

401401
/**
402402
* Return information about the last order items
403+
*
403404
* @link https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data/#contents
404405
*
405406
* @return array
@@ -555,7 +556,7 @@ public function getUserDataFromSession(): array
555556
/**
556557
* Get Hash value
557558
*
558-
* @param $string
559+
* @param string $string
559560
* @return string
560561
*/
561562
private function hashValue($string): string

app/code/Meta/Conversion/Controller/Pixel/ProductInfoForAddToCart.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Magento\Framework\Controller\ResultInterface;
2626
use Magento\Framework\Data\Form\FormKey\Validator;
2727
use Magento\Framework\Pricing\Helper\Data;
28+
use Magento\Framework\View\Asset\File\NotFoundException;
2829
use Meta\BusinessExtension\Helper\MagentoDataHelper;
2930
use Meta\Conversion\Helper\EventIdGenerator;
3031
use Meta\BusinessExtension\Helper\FBEHelper;
@@ -108,7 +109,7 @@ private function getCategory(Product $product): ?string
108109
$category = $categoryModel->load($categoryId);
109110
$categoryNames[] = $category->getName();
110111
}
111-
return addslashes(implode(',', $categoryNames));
112+
return addslashes(implode(',', $categoryNames)); // phpcs: ignore
112113
} else {
113114
return null;
114115
}
@@ -117,7 +118,7 @@ private function getCategory(Product $product): ?string
117118
/**
118119
* Get formatted price
119120
*
120-
* @param $product
121+
* @param Product $product
121122
* @return float|string
122123
*/
123124
private function getPriceValue($product)
@@ -128,8 +129,8 @@ private function getPriceValue($product)
128129
/**
129130
* Get Product Info
130131
*
131-
* @param $productSku
132-
* @param null $productId
132+
* @param mixed $productSku
133+
* @param mixed $productId
133134
* @return array
134135
*/
135136
private function getProductInfo($productSku, $productId = null): array
@@ -153,7 +154,10 @@ private function getProductInfo($productSku, $productId = null): array
153154
}
154155

155156
/**
156-
* @ingeritdoc
157+
* Execute function
158+
*
159+
* @returns ResultInterface
160+
* @throws NotFoundException
157161
*/
158162
public function execute()
159163
{
@@ -178,7 +182,7 @@ public function execute()
178182
/**
179183
* Track the server event
180184
*
181-
* @param $eventId
185+
* @param string $eventId
182186
* @return void
183187
*/
184188
public function trackServerEvent($eventId): void

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
], function ($) {
77

88
function trackAddToCart(content_ids, content_name, content_category, value, eventId) {
9-
fbq('set', 'agent', '<?= /* @escapeNotVerified */ $block->getFacebookAgentVersion() ?>', '<?= /* @escapeNotVerified */ $block->getFacebookPixelID() ?>');
9+
fbq('set', 'agent', '<?= /* @noEscape */ $ $block->getFacebookAgentVersion() ?>', '<?= /* @noEscape */ $block->getFacebookPixelID() ?>');
1010
fbq('track', 'AddToCart', {
11-
source: "<?= /* @escapeNotVerified */ $block->getSource() ?>",
12-
pluginVersion: "<?= /* @escapeNotVerified */ $block->getPluginVersion() ?>",
13-
content_type: "<?= /* @escapeNotVerified */ $block->getContentType() ?>",
14-
currency: "<?= /* @escapeNotVerified */ $block->getCurrency() ?>",
11+
source: "<?= /* @noEscape */ $block->getSource() ?>",
12+
pluginVersion: "<?= /* @noEscape */ $block->getPluginVersion() ?>",
13+
content_type: "<?= /* @noEscape */ $block->getContentType() ?>",
14+
currency: "<?= /* @noEscape */ $block->getCurrency() ?>",
1515
content_ids: content_ids,
1616
content_name: content_name,
1717
content_category: content_category,
@@ -23,7 +23,7 @@
2323
);
2424
}
2525

26-
var product_info_url = '<?= /* @escapeNotVerified */ $block->getProductInfoUrl() ?>';
26+
var product_info_url = '<?= /* @noEscape */ $block->getProductInfoUrl() ?>';
2727

2828
$(document).on('ajax:addToCart', function (event, data) {
2929
var configurableProduct = data.form.data().mageConfigurable;

0 commit comments

Comments
 (0)