Passed
Push — master ( 2cda12...3e0ae5 )
by Melech
02:04 queued 37s
created

SoftDeletable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormattedDeletedDate() 0 3 1
A getDateDeletedField() 0 3 1
A getDeletedDateFormat() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Valkyrja Framework package.
7
 *
8
 * (c) Melech Mizrachi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Valkyrja\Orm\Entity\Trait;
15
16
use Valkyrja\Orm\Constant\DateFormat;
0 ignored issues
show
Bug introduced by
The type Valkyrja\Orm\Constant\DateFormat was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use Valkyrja\Orm\Support\Helpers;
18
19
/**
20
 * Trait SoftDeletableEntity.
21
 *
22
 * @author Melech Mizrachi
23
 */
24
trait SoftDeletable
25
{
26
    /**
27
     * @inheritDoc
28
     */
29
    public static function getDeletedDateFormat(): string
30
    {
31
        return DateFormat::DEFAULT;
32
    }
33
34
    /**
35
     * @inheritDoc
36
     */
37
    public static function getFormattedDeletedDate(): string
38
    {
39
        return Helpers::getFormattedDate(static::getDeletedDateFormat());
40
    }
41
42
    /**
43
     * @inheritDoc
44
     */
45
    public static function getDateDeletedField(): string
46
    {
47
        return 'date_deleted';
48
    }
49
}
50