for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helick\GTM;
use Helick\GTM\Contracts\Bootable;
final class EventTracking implements Bootable
{
/**
* Boot the service.
*
* @return void
*/
public static function boot(): void
$self = new static;
add_action('wp_enqueue_scripts', [$self, 'enqueueScripts']);
add_action
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
}
* Enqueue scripts.
public function enqueueScripts(): void
* Control whether to load the data attribute tracking script.
* @param bool $isEnabled
$isEnabled = apply_filters('helick_gtm_enable_event_tracking', true);
apply_filters
$isEnabled = /** @scrutinizer ignore-call */ apply_filters('helick_gtm_enable_event_tracking', true);
if (!$isEnabled) {
return;
wp_enqueue_script(
wp_enqueue_script
'helick-gtm-event-tracking',
plugin_dir_url(dirname(__FILE__)) . 'resources/js/event-tracking.js',
plugin_dir_url
[],
filemtime(plugin_dir_path(dirname(__FILE__)) . 'resources/js/event-tracking.js'),
plugin_dir_path
filemtime(/** @scrutinizer ignore-call */ plugin_dir_path(dirname(__FILE__)) . 'resources/js/event-tracking.js'),
true
);