Constraint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorMessage() 0 4 1
A setErrorMessage() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Linio\Component\Input\Constraint;
6
7
abstract class Constraint implements ConstraintInterface
0 ignored issues
show
Coding Style introduced by
Constraint does not seem to conform to the naming convention (^Abstract|Factory$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $errorMessage;
13
14
    public function getErrorMessage(string $field): string
15
    {
16
        return sprintf('[%s] %s', $field, $this->errorMessage);
17
    }
18
19
    public function setErrorMessage(string $errorMessage)
20
    {
21
        $this->errorMessage = $errorMessage;
22
    }
23
}
24