ArticleListMethodValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isValid() 0 4 1
1
<?php
2
3
namespace Stp\SndApi\News\Validator;
4
5
use Stp\SndApi\Common\ValidatorInterface;
6
7
class ArticleListMethodValidator implements ValidatorInterface
8
{
9
    private $allowedMethods = [
10
        'desked',
11
        'auto'
12
    ];
13
14
    private $method;
15
16
    /**
17
     * @param string $method
18
     */
19
    public function __construct($method)
20
    {
21
        $this->method = $method;
22
    }
23
24
    /**
25
     * @return bool
26
     */
27
    public function isValid()
28
    {
29
        return in_array($this->method, $this->allowedMethods);
30
    }
31
}
32