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.
Passed
Push — master ( e9c651...e1baf6 )
by Christian
02:19
created

DeleteableTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 11
dl 0
loc 57
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDeletedAt() 0 3 1
A setDeleted() 0 6 2
A isDeleted() 0 3 1
A setDeletedAt() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\Doctrine\Model\Traits;
13
14
trait DeleteableTrait
15
{
16
    /**
17
     * @var \DateTime|null
18
     */
19
    protected $deletedAt;
20
21
    /**
22
     * Get deletedAt.
23
     *
24
     * @return \DateTime|null
25
     */
26
    public function getDeletedAt(): ?\DateTime
27
    {
28
        return $this->deletedAt;
29
    }
30
31
    /**
32
     * Set deletedAt.
33
     *
34
     * @param \DateTime|null $deletedAt
35
     */
36
    public function setDeletedAt(?\DateTime $deletedAt): void
37
    {
38
        $this->deletedAt = $deletedAt;
39
    }
40
41
    /**
42
     * Set deleted.
43
     *
44
     * @param bool $deleted
45
     */
46
    public function setDeleted(bool $deleted): void
47
    {
48
        if ($deleted) {
49
            $this->setDeletedAt(new \DateTime());
50
        } else {
51
            $this->setDeletedAt(null);
52
        }
53
    }
54
55
    /**
56
     * Get deleted.
57
     *
58
     * @return bool
59
     */
60
    public function isDeleted(): bool
61
    {
62
        return null !== $this->deletedAt;
63
    }
64
}
65