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

Hooks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 17 2
A isEnabled() 0 3 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Integrations\SEOPress;
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', 'seopress_schemas_auto_course_json'],
16
            ['filterSchema', 'seopress_schemas_auto_event_json'],
17
            ['filterSchema', 'seopress_schemas_auto_faq_json'],
18
            ['filterSchema', 'seopress_schemas_auto_job_json'],
19
            ['filterSchema', 'seopress_schemas_auto_lb_json'],
20
            ['filterSchema', 'seopress_schemas_auto_product_json'],
21
            ['filterSchema', 'seopress_schemas_auto_recipe_json'],
22
            ['filterSchema', 'seopress_schemas_auto_service_json'],
23
            ['filterSchema', 'seopress_schemas_auto_softwareapp_json'],
24
            ['filterSchema', 'seopress_schemas_auto_video_json'],
25
            ['filterSchemas', 'seopress_json_schema_generator_get_jsons'],
26
        ]);
27
    }
28
29
    protected function isEnabled(): bool
30
    {
31
        return 'seopress' === $this->option('schema.integration.plugin');
32
    }
33
}
34