SynchronizableFormValidator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getJsonData() 0 12 2
A isLive() 0 4 1
1
<?php
2
3
namespace fieldwork\validators;
4
5
use fieldwork\components\Field;
6
use fieldwork\Synchronizable;
7
use fieldwork\validators;
8
9
abstract class SynchronizableFormValidator extends FormValidator implements Synchronizable
10
{
11
12
    public function getJsonData ()
13
    {
14
        $fields = array();
15
        foreach ($this->inflictsFields as $field)
16
            /* @var $field Field */
17
            $fields[] = $field->getName();
18
        return array(
19
            'inflictedFields' => $fields,
20
            'error'           => $this->errorMsg,
21
            'method'          => $this->describeObject()
22
        );
23
    }
24
25
    public function isLive ()
26
    {
27
        return true;
28
    }
29
30
}