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

Hooks::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 14
c 1
b 0
f 1
dl 0
loc 17
ccs 0
cts 15
cp 0
rs 9.7998
cc 2
nc 2
nop 0
crap 6
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