| Total Complexity | 10 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Demo |
||
| 6 | { |
||
| 7 | public $name; |
||
| 8 | public $format = null; |
||
| 9 | public $fields = array(); |
||
| 10 | public $order = 1000; |
||
| 11 | |||
| 12 | function __construct($name) |
||
| 13 | { |
||
| 14 | $this->name = $name; |
||
| 15 | } |
||
| 16 | |||
| 17 | function init() |
||
|
|
|||
| 18 | { |
||
| 19 | } |
||
| 20 | |||
| 21 | static function create($name) |
||
| 37 | } |
||
| 38 | |||
| 39 | function getFormat() |
||
| 40 | { |
||
| 41 | return 'as input'; |
||
| 42 | } |
||
| 43 | |||
| 44 | function addField($field) |
||
| 45 | { |
||
| 46 | $this->fields[$field->name] = $field; |
||
| 47 | } |
||
| 48 | |||
| 49 | function __toString() |
||
| 50 | { |
||
| 51 | return $this->name; |
||
| 52 | } |
||
| 53 | |||
| 54 | function text() |
||
| 56 | } |
||
| 57 | |||
| 58 | function fval($name) |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.