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

Hooks::isEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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