StringField   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 1

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 4 2
1
<?php
2
3
/**
4
 * A String field
5
 */
6
namespace Rocket\Entities\Fields;
7
8
use Rocket\Entities\Field;
9
10
/**
11
 * String Field
12
 *
13
 * @property string $value The field's value
14
 */
15
class StringField extends Field
16
{
17
    /**
18
     * @var string The table associated with the model.
19
     */
20
    public $table = 'field_string';
21
22
    /**
23
     * Checks if a field is valid
24
     *
25
     * @param mixed $value The value to validate
26
     * @return bool
27
     */
28 141
    protected function isValid($value)
29
    {
30 141
        return is_string($value) && strlen($value) <= 255;
31
    }
32
}
33