TestForm::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Code4\Forms;
4
5
class TestForm extends AbstractForm {
6
7
    protected $messages = [
8
        'required' => 'Pole :attribute jest wymagane'
9
    ];
10
11
    protected $fieldNames = [
12
        'name' => 'Nazwa firmy'
13
    ];
14
15
    protected $customRules = [
16
        'name' => 'customValidate'
17
    ];
18
19
    //Override construct to load config
20
    public function __construct() {
21
        parent::__construct();
22
        $this->loadFromConfigYaml(__DIR__ . '/../config/test.yml');
23
24
25
    }
26
27
    //Custom validation class
28
    public function customValidate($request) {
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
        return null;
30
    }
31
32
}