Passed
Push — master ( 919d61...4a3edd )
by Thomas
03:54 queued 02:09
created

CrudFieldAbstract::hint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 5 and the first side effect is on line 40.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Webfactor\Laravel\Backpack\FluentSyntax\Contracts;
4
5
abstract class CrudFieldAbstract extends CrudAbstract implements CrudFieldInterface
6
{
7
    /*
8
    |--------------------------------------------------------------------------
9
    | Methods available for all Field Types
10
    |--------------------------------------------------------------------------
11
    */
12
13
    public function prefix(string $prefix)
14
    {
15
        $this->options['prefix'] = $prefix;
16
17
        return $this;
18
    }
19
20
    public function suffix(string $suffix)
21
    {
22
        $this->options['suffix'] = $suffix;
23
24
        return $this;
25
    }
26
27
    public function default(string $default)
0 ignored issues
show
Coding Style introduced by
Possible parse error: non-abstract method defined as abstract
Loading history...
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...
28
    {
29
        $this->options['default'] = $default;
30
31
        return $this;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $this.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
32
    }
33
34
    public function hint(string $hint)
35
    {
36
        $this->options['hint'] = $hint;
37
38
        return $this;
39
    }
40
}
41