Check   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A unsnooze() 0 3 1
A snooze() 0 3 1
A enable() 0 5 1
A disable() 0 5 1
A requestRun() 0 3 1
1
<?php
2
3
namespace OhDear\PhpSdk\Resources;
4
5
class Check extends ApiResource
6
{
7
    public int $id;
8
9
    public string $type;
10
11
    /*
12
     * The human readable version of type.
13
     */
14
    public string $label;
15
16
    public bool $enabled;
17
18
    public function enable(): void
19
    {
20
        $updatedCheck = $this->ohDear->enableCheck($this->id);
0 ignored issues
show
Bug introduced by
The method enableCheck() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        /** @scrutinizer ignore-call */ 
21
        $updatedCheck = $this->ohDear->enableCheck($this->id);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
22
        $this->enabled = $updatedCheck->enabled;
23
    }
24
25
    public function disable(): void
26
    {
27
        $updatedCheck = $this->ohDear->disableCheck($this->id);
28
29
        $this->enabled = $updatedCheck->enabled;
30
    }
31
32
    public function requestRun(): void
33
    {
34
        $this->ohDear->requestRun($this->id);
35
    }
36
37
    public function snooze(int $minutes): void
38
    {
39
        $this->ohDear->snooze($this->id, $minutes);
40
    }
41
42
    public function unsnooze(): void
43
    {
44
        $this->ohDear->unsnooze($this->id);
45
    }
46
}
47