Passed
Push — master ( 179943...1193c4 )
by Darko
09:13
created

TvPipe   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 23
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A categorize() 0 3 1
A __construct() 0 3 1
A getName() 0 3 1
A shouldSkip() 0 3 1
1
<?php
2
3
namespace App\Services\Categorization\Pipes;
4
5
use App\Services\Categorization\CategorizationResult;
6
use App\Services\Categorization\Categorizers\TvCategorizer;
7
use App\Services\Categorization\ReleaseContext;
8
9
/**
10
 * Pipe for TV content categorization.
11
 */
12
class TvPipe extends AbstractCategorizationPipe
13
{
14
    protected int $priority = 20;
15
    private TvCategorizer $categorizer;
16
17
    public function __construct()
18
    {
19
        $this->categorizer = new TvCategorizer();
20
    }
21
22
    public function getName(): string
23
    {
24
        return 'TV';
25
    }
26
27
    protected function shouldSkip(ReleaseContext $context): bool
28
    {
29
        return $this->categorizer->shouldSkip($context);
30
    }
31
32
    protected function categorize(ReleaseContext $context): CategorizationResult
33
    {
34
        return $this->categorizer->categorize($context);
35
    }
36
}
37
38