Passed
Branch master (056094)
by Andreas
04:47
created

midgard_reflector_object::is_abstract()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * @author CONTENT CONTROL http://www.contentcontrol-berlin.de/
4
 * @copyright CONTENT CONTROL http://www.contentcontrol-berlin.de/
5
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
6
 */
7
8
use midgard\portable\storage\connection;
9
10
class midgard_reflector_object
11
{
12 1
    public static function get_property_primary($classname)
0 ignored issues
show
Unused Code introduced by
The parameter $classname 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

12
    public static function get_property_primary(/** @scrutinizer ignore-unused */ $classname)

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...
13
    {
14 1
        return 'id';
15
    }
16
17 1
    public static function get_property_up($classname)
18
    {
19 1
        return midgard_object_class::get_property_up($classname);
20
    }
21
22 1
    public static function get_property_parent($classname)
23
    {
24 1
        return midgard_object_class::get_property_parent($classname);
25
    }
26
27 1
    public static function get_property_unique($classname)
28
    {
29 1
        $cm = connection::get_em()->getClassMetadata($classname);
30 1
        if (empty($cm->midgard['unique_fields'])) {
31 1
            return null;
32
        }
33 1
        return $cm->midgard['unique_fields'][0];
34
    }
35
36 1
    public static function list_children($classname)
37
    {
38 1
        $cm = connection::get_em()->getClassMetadata($classname);
39 1
        if (empty($cm->midgard['childtypes'])) {
40 1
            return [];
41
        }
42
        // @todo We filter out useful information (parent field name) in the name of mgd2 compat.
43 1
        return array_fill_keys(array_keys($cm->midgard['childtypes']), '');
44
    }
45
46 2
    public static function has_metadata_class($classname)
47
    {
48 2
        return midgard_object_class::has_metadata($classname);
49
    }
50
51 1
    public static function get_metadata_class($classname)
52
    {
53 1
        if (!self::has_metadata_class($classname)) {
54 1
            return null;
55
        }
56 1
        return 'midgard_metadata';
57
    }
58
59
    public static function get_schema_value($classname, $node_name)
0 ignored issues
show
Unused Code introduced by
The parameter $node_name 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

59
    public static function get_schema_value($classname, /** @scrutinizer ignore-unused */ $node_name)

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

59
    public static function get_schema_value(/** @scrutinizer ignore-unused */ $classname, $node_name)

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...
60
    {
61
        throw new Exception('Not implemented yet');
62
    }
63
64
    public static function is_mixin($classname)
0 ignored issues
show
Unused Code introduced by
The parameter $classname 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

64
    public static function is_mixin(/** @scrutinizer ignore-unused */ $classname)

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...
65
    {
66
        return false;
67
    }
68
69
    public static function is_interface($classname)
0 ignored issues
show
Unused Code introduced by
The parameter $classname 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

69
    public static function is_interface(/** @scrutinizer ignore-unused */ $classname)

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...
70
    {
71
        return false;
72
    }
73
74
    public static function is_abstract($classname)
0 ignored issues
show
Unused Code introduced by
The parameter $classname 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

74
    public static function is_abstract(/** @scrutinizer ignore-unused */ $classname)

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...
75
    {
76
        return false;
77
    }
78
79
    public static function list_defined_properties($classname)
0 ignored issues
show
Unused Code introduced by
The parameter $classname 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

79
    public static function list_defined_properties(/** @scrutinizer ignore-unused */ $classname)

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...
80
    {
81
        throw new Exception('Not implemented yet');
82
    }
83
}