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

Hooks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 7 2
A isEnabled() 0 3 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\RankMath;
4
5
use GeminiLabs\SiteReviews\Integrations\IntegrationHooks;
6
7
class Hooks extends IntegrationHooks
8
{
9
    public function run(): void
10
    {
11
        if (!$this->isEnabled()) {
12
            return;
13
        }
14
        $this->hook(Controller::class, [
15
            ['filterSchema', 'rank_math/schema/validated_data', 20],
16
        ]);
17
    }
18
19
    protected function isEnabled(): bool
20
    {
21
        return 'rankmath' === $this->option('schema.integration.plugin');
22
    }
23
}
24