Completed
Push — master ( 7bebed...2fd43b )
by Lars
01:41
created

MinLength::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace voku\HtmlFormValidator\Rules;
4
5
use Respect\Validation\Rules\AbstractRule;
6
use Respect\Validation\Rules\Length;
7
8 View Code Duplication
class MinLength extends AbstractRule
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
  protected $minLength;
11
12
  public function __construct($minLength = null)
13
  {
14
    $this->minLength = $minLength;
15
  }
16
17
  public function validate($input)
18
  {
19
    $internValidate = new Length($this->minLength, null);
20
21
    return $internValidate->validate($input);
22
  }
23
}
24