PropertyCreatedAtRequiredTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCreatedAt() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the zibios/sharep.
7
 *
8
 * (c) Zbigniew Ślązak
9
 */
10
11
namespace App\Entity\Traits;
12
13
use ApiPlatform\Core\Annotation as OA;
14
use Doctrine\ORM\Mapping as ORM;
15
use Gedmo\Mapping\Annotation as Gedmo;
16
use Symfony\Component\Serializer\Annotation as SA;
17
18
trait PropertyCreatedAtRequiredTrait
19
{
20
    /**
21
     * @var \DateTimeImmutable|null
22
     * @ORM\Column(name="created_at", type="datetime_immutable", nullable=false)
23
     * @Gedmo\Versioned
24
     * @Gedmo\Timestampable(on="create")
25
     * @OA\ApiFilter(
26
     *     ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter::class,
27
     *     strategy="ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_BEFORE"
28
     * )
29
     * @SA\Groups({"read"})
30
     */
31
    private $createdAt;
32
33
    /**
34
     * @return \DateTimeImmutable|null
35
     */
36
    public function getCreatedAt(): ?\DateTimeImmutable
37
    {
38
        return $this->createdAt;
39
    }
40
}
41