PostTypeFieldConnector   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A connector() 0 12 1
A name() 0 4 1
1
<?php
2
3
namespace LIN3S\WPFoundation\PostTypes\Fields;
4
5
6
class PostTypeFieldConnector implements FieldConnector
7
{
8
    private $postType;
9
10
    public function __construct($postType)
11
    {
12
        $this->postType = $postType;
13
    }
14
15
    public function connector()
16
    {
17
        return [
18
            [
19
                [
20
                    'param'    => 'post_type',
21
                    'operator' => '==',
22
                    'value'    => $this->postType,
23
                ],
24
            ],
25
        ];
26
    }
27
28
    public function name()
29
    {
30
        return $this->postType;
31
    }
32
}