Completed
Push0c75f6...35d3bb
passed — Build
created

Boolean   A

↳ Parent: Project

Coupling/Cohesion

Components 0
Dependencies 1

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
ccs 3
cts 3
cp 1
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 6 1
1
<?php namespace Rocket\Entities\Fields;
2
3
use Rocket\Entities\Field;
4
5
class Boolean extends Field
6
{
7
    public $table = 'field_boolean';
8
9
    /**
10
     * {@inheritdoc}
11
     */
12
    protected $casts = [
13
        'value' => 'boolean',
14
    ];
15
16
    /**
17
     * {@inheritdoc}
18
     */
19 27
    protected function isValid($value)
20
    {
21 27
        $acceptable = [true, false, 0, 1, '0', '1'];
22
23 27
        return in_array($value, $acceptable, true);
24
    }
25
}
26