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

MiscPipe   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A __construct() 0 3 1
A categorize() 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\MiscCategorizer;
7
use App\Services\Categorization\ReleaseContext;
8
9
/**
10
 * Pipe for miscellaneous content and hash detection.
11
 * This runs last as a fallback.
12
 */
13
class MiscPipe extends AbstractCategorizationPipe
14
{
15
    protected int $priority = 100;
16
    private MiscCategorizer $categorizer;
17
18
    public function __construct()
19
    {
20
        $this->categorizer = new MiscCategorizer();
21
    }
22
23
    public function getName(): string
24
    {
25
        return 'Misc';
26
    }
27
28
    protected function categorize(ReleaseContext $context): CategorizationResult
29
    {
30
        return $this->categorizer->categorize($context);
31
    }
32
}
33
34