ServiceExists   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
getPrefix() 0 1 ?
getMessage() 0 1 ?
A validatedBy() 0 4 1
1
<?php
2
3
namespace Storeman\Validation\Constraints;
4
5
use Symfony\Component\Validator\Constraint;
6
7
abstract class ServiceExists extends Constraint
8
{
9
    /**
10
     * Has to return a string prefix which in conjunction with the validated value has to exist as a service name.
11
     *
12
     * @return string
13
     */
14
    abstract public function getPrefix(): string;
15
16
    /**
17
     * @return string
18
     */
19
    abstract public function getMessage(): string;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    final public function validatedBy()
25
    {
26
        return ExistingServiceValidator::class;
27
    }
28
}
29