Completed
Push — fix-2494 ( 3153ee...40d9bb )
by Sam
13:43 queued 06:38
created

TestValidator::php()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\Forms\Tests\ValidatorTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\Forms\Validator;
7
8
class TestValidator extends Validator implements TestOnly
9
{
10
11
    /**
12
     * Requires a specific field for test purposes.
13
     *
14
     * @param array $data
15
     * @return null
16
     */
17
    public function php($data)
18
    {
19
        foreach ($data as $field => $data) {
20
            $this->validationError($field, 'error');
21
        }
22
    }
23
}
24