Negation   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFilter() 0 4 1
A __toString() 0 4 1
A dump() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the tmilos/scim-filter-parser package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Tmilos\ScimFilterParser\Ast;
13
14
class Negation extends Factor
15
{
16
    /** @var Filter */
17
    public $filter;
18
19
    /**
20
     * @param Filter $filter
21
     */
22
    public function __construct(Filter $filter)
23
    {
24
        $this->filter = $filter;
25
    }
26
27
    /**
28
     * @return Filter
29
     */
30
    public function getFilter()
31
    {
32
        return $this->filter;
33
    }
34
35
    public function __toString()
36
    {
37
        return sprintf('not (%s)', $this->filter);
38
    }
39
40
    public function dump()
41
    {
42
        return [
43
            'Negation' => $this->filter->dump(),
44
        ];
45
    }
46
}
47