Constraint::setErrorMessage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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