Test Failed
Push — master ( 50dd93...f69d16 )
by Chris
12:03
created

getEditedXTaxonomyPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Leonidas\Hooks;
4
5
use Closure;
6
7
trait TargetsEditedXTaxonomyHook
8
{
9
    protected function targetEditedXTaxonomyHook()
10
    {
11
        add_action(
12
            "edited_{$this->getTaxonomy()}",
13
            Closure::fromCallable([$this, 'doEditedXTaxonomyAction']),
14
            $this->getEditedXTaxonomyPriority(),
15
            PHP_INT_MAX
16
        );
17
18
        return $this;
19
    }
20
21
    protected function getEditedXTaxonomyPriority(): int
22
    {
23
        return 10;
24
    }
25
26
    abstract protected function doEditedXTaxonomyAction(int $termId, int $ttId): void;
27
28
    abstract protected function getTaxonomy(): string;
29
}
30