PostTypeFieldConnector::name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}