NotOverlappedDates   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTargets() 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\Validator\Constraints;
12
13
use Symfony\Component\Validator\Constraint;
14
15
/**
16
 * @Annotation
17
 */
18
class NotOverlappedDates extends Constraint
19
{
20
    public const INVALID_FROM_DATE = 'FromDate {{ fromDate }} is invalid';
21
    public const INVALID_TO_DATE = 'ToDate {{ toDate }} is invalid';
22
    public const INVALID_ORDER = 'FromDate {{ fromDate }} should be before ToDate {{ toDate }}';
23
    public const INVALID_PERIOD_OVERLAPPED = 'Period {{ fromDate }} - {{ toDate }} overlapped by [{{ periods }}]';
24
    public $message = '{{ message }}';
25
    /** @var string|null */
26
    public $fromDateProperty;
27
    /** @var string|null */
28
    public $toDateProperty;
29
    /** @var string|null */
30
    public $fromDateMethod;
31
    /** @var string|null */
32
    public $toDateMethod;
33
34 4
    public function getTargets(): string
35
    {
36 4
        return self::CLASS_CONSTRAINT;
37
    }
38
}
39