MutationWithInput   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 8
c 1
b 0
f 0
dl 0
loc 40
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isNotEmpty() 0 3 2
A getMutation() 0 3 1
A getInputType() 0 3 1
1
<?php
2
namespace DeInternetJongens\LighthouseUtils\Generators\Classes;
3
4
class MutationWithInput
5
{
6
    /** @var string $mutation */
7
    private $mutation;
8
9
    /** @var string $inputType */
10
    private $inputType;
11
12
    /**
13
     * @param string $mutation
14
     * @param string $inputType
15
     */
16
    public function __construct(string $mutation, string $inputType)
17
    {
18
        $this->mutation = $mutation;
19
        $this->inputType = $inputType;
20
    }
21
22
    /**
23
     * @return bool
24
     */
25
    public function isNotEmpty(): bool
26
    {
27
        return (! empty($this->getMutation()) && ! empty($this->getInputType()));
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getMutation(): string
34
    {
35
        return $this->mutation;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getInputType(): string
42
    {
43
        return $this->inputType;
44
    }
45
}
46