Validator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 27
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A required() 0 4 1
A buildChain() 0 2 1
A optional() 0 4 1
1
<?php
2
3
namespace Logikos\Util\Config\Field\Adapter\Particle;
4
5
use Particle\Validator as Particle;
6
7
class Validator extends Particle\Validator {
8
  /**
9
   * @param string $key
10
   * @param null   $name
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $name is correct as it would always require null to be passed?
Loading history...
11
   * @param bool   $allowEmpty
12
   * @return Chain
13
   */
14 8
  public function required($key, $name = null, $allowEmpty = false) {
15
    /** @var Chain $chain */
16 8
    $chain = parent::required($key, $name, $allowEmpty);
17 8
    return $chain;
18
  }
19
20
  /**
21
   * @param string $key
22
   * @param null   $name
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $name is correct as it would always require null to be passed?
Loading history...
23
   * @param bool   $allowEmpty
24
   * @return Chain
25
   */
26 2
  public function optional($key, $name = null, $allowEmpty = true) {
27
    /** @var Chain $chain */
28 2
    $chain = parent::optional($key, $name, $allowEmpty);
29 2
    return $chain;
30
  }
31
32 10
  protected function buildChain($key, $name, $required, $allowEmpty) {
33 10
    return new Chain($key, $name, $required, $allowEmpty);
34
  }
35
}