Address::validatedBy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the BazingaGeocoderBundle package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Bazinga\GeocoderBundle\Validator\Constraint;
14
15
use Symfony\Component\Validator\Constraint;
16
17
/**
18
 * @Annotation
19
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
20
 *
21
 * @author Tomas Norkūnas <[email protected]>
22
 */
23
class Address extends Constraint
24
{
25
    const INVALID_ADDRESS_ERROR = '2243aa07-2ea7-4eb7-962c-6a9586593f2c';
26
27
    protected static $errorNames = [
28
        self::INVALID_ADDRESS_ERROR => 'INVALID_ADDRESS_ERROR',
29
    ];
30
31
    public $service = AddressValidator::class;
32
33
    public $message = 'Address {{ address }} is not valid.';
34
35
    public function validatedBy()
36
    {
37
        return $this->service;
38
    }
39
}
40