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

TestValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A php() 0 6 2
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