Completed
Branch master (fd4772)
by Pierre-Henry
37:10
created

Validation::__destruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Many changes have been made in this file.
4
 * By Pierre-Henry SORIA.
5
 */
6
7
namespace PFBC;
8
9
use PH7\Framework\Security\Validate\Validate;
10
11
abstract class Validation extends Base
12
{
13
    protected $oValidate, $message;
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
14
15
    public function __construct($message = '')
16
    {
17
        $this->oValidate = new Validate;
18
19
        if (!empty($message)) {
20
            $this->message = t('%element% is invalid.');
21
          }
22
    }
23
24
    public function getMessage()
25
    {
26
        return $this->message;
27
    }
28
29
    public function isNotApplicable($value)
30
    {
31
        return (is_null($value) || is_array($value) || $value === '');
32
    }
33
34
    public abstract function isValid($value);
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
35
}
36