Validator::buildChain()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 4
crap 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
}