LiteralHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 25
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\Model\Mapper|LiteralHandler $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
            'requiresWrite' => false,
21
            'requiresSalsifyObjects' => false,
22
            'allowsModification' => true,
23
        ],
24
    ];
25
26
    /**
27
     * @param string|SilverStripe\ORM\DataObject $class
0 ignored issues
show
Bug introduced by
The type Dynamic\Salsify\TypeHand...erStripe\ORM\DataObject was not found. Did you mean SilverStripe\ORM\DataObject? If so, make sure to prefix the type with \.
Loading history...
28
     * @param $data
29
     * @param $dataField
30
     * @param $config
31
     * @param $dbField
32
     *
33
     * @return string|boolean|int|double
34
     */
35
    public function handleLiteralType($class, $data, $dataField, $config, $dbField)
0 ignored issues
show
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

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

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

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

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

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

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 $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

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

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...
36
    {
37
        return $dataField;
38
    }
39
}
40