GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#688)
by
unknown
18:52
created

DateFormat::setFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Aios.
5
 */
6
namespace SleepingOwl\Admin\Traits;
7
8
trait DateFormat
9
{
10
    /**
11
     * @return string
12
     */
13
    public function getFormat()
14
    {
15
        return $this->format;
0 ignored issues
show
Bug introduced by
The property format does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
16
    }
17
18
    /**
19
     * @return string
20
     */
21
    public function getTimezone()
22
    {
23
        if (is_null($this->timezone)) {
24
            $this->timezone = config('sleeping_owl.timezone');
0 ignored issues
show
Bug introduced by
The property timezone does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
        }
26
27
        return $this->timezone;
28
    }
29
30
    /**
31
     * @param string|null $format
32
     *
33
     * @return $this
34
     */
35
    public function setFormat($format)
36
    {
37
        $this->format = $format;
38
39
        return $this;
40
    }
41
42
    /**
43
     * @param string $timezone
44
     *
45
     * @return $this
46
     */
47
    public function setTimezone($timezone)
48
    {
49
        $this->timezone = $timezone;
50
51
        return $this;
52
    }
53
}
54