Passed
Pull Request — master (#21)
by Matthew
01:49
created

LiteralHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleLiteralType() 0 3 1
1
<?php
2
3
namespace Dynamic\Salsify\TypeHandler;
4
5
use SilverStripe\Core\Extension;
6
7
/**
8
 * Class LiteralHandler
9
 * @package Dynamic\Salsify\TypeHandler
10
 *
11
 * @property-read \Dynamic\Salsify\TypeHandler\LiteralHandler|\Dynamic\Salsify\Model\Mapper $owner
12
 */
13
class LiteralHandler extends Extension
14
{
15
    /**
16
     * @var array
17
     */
18
    private static $field_types = [
0 ignored issues
show
introduced by
The private property $field_types is not used, and could be removed.
Loading history...
19
        'Literal',
20
    ];
21
22
    /**
23
     * @param $data
24
     * @param $dataField
25
     * @param $config
26
     * @param $dbField
27
     * @param string |\SilverStripe\ORM\DataObject $class
28
     * @return string|int
29
     *
30
     * @return string|boolean|int|double
31
     */
32
    public function handleLiteralType($data, $dataField, $config, $dbField, $class)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function handleLiteralType($data, $dataField, /** @scrutinizer ignore-unused */ $config, $dbField, $class)

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

Loading history...
Unused Code introduced by
The parameter $dbField is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function handleLiteralType($data, $dataField, $config, /** @scrutinizer ignore-unused */ $dbField, $class)

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

Loading history...
Unused Code introduced by
The parameter $class is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function handleLiteralType($data, $dataField, $config, $dbField, /** @scrutinizer ignore-unused */ $class)

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

Loading history...
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function handleLiteralType(/** @scrutinizer ignore-unused */ $data, $dataField, $config, $dbField, $class)

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

Loading history...
33
    {
34
        return $dataField;
35
    }
36
}
37