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.

DeleteableTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 29
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
use DateTime;
15
16
trait DeleteableTrait
17
{
18
    /**
19
     * @var DateTime|null
20
     */
21
    protected $deletedAt;
22
23
    public function getDeletedAt(): ?DateTime
24
    {
25
        return $this->deletedAt;
26
    }
27
28
    public function setDeletedAt(?DateTime $deletedAt): void
29
    {
30
        $this->deletedAt = $deletedAt;
31
    }
32
33
    public function setDeleted(bool $deleted): void
34
    {
35
        if ($deleted) {
36
            $this->setDeletedAt(new DateTime());
37
        } else {
38
            $this->setDeletedAt(null);
39
        }
40
    }
41
42
    public function isDeleted(): bool
43
    {
44
        return null !== $this->deletedAt;
45
    }
46
}
47