Test Failed
Push — develop ( 1da57b...1707fa )
by Paul
07:25
created

Hooks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 8
dl 0
loc 17
ccs 0
cts 8
cp 0
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 2
A isInstalled() 0 3 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\JetWooBuilder;
4
5
use GeminiLabs\SiteReviews\Integrations\IntegrationHooks;
6
7
class Hooks extends IntegrationHooks
8
{
9
    public function run(): void
10
    {
11
        if (!$this->isInstalled()) {
12
            return;
13
        }
14
        $this->hook(Controller::class, [
15
            ['filterProductRatingHtml', 'jet-woo-builder/template-functions/product-rating'],
16
            ['modifyWidgetControls', 'elementor/widget/jet-woo-products/skins_init'],
17
            ['modifyWidgetControls', 'elementor/widget/jet-woo-products-list/skins_init'],
18
        ]);
19
    }
20
21
    protected function isInstalled(): bool
22
    {
23
        return function_exists('jet_woo_builder');
24
    }
25
}
26