Completed
Push — master ( a94ac3...322d21 )
by Richard
05:34
created

Property   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fluid_interface() 0 5 1
A register_listeners() 0 2 1
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 *
5
 * Copyright (c) 2016 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received
8
 * a copy of the licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Rules;
12
13
use Lechimp\Dicto\Definition as Def;
14
use Lechimp\Dicto\Indexer\ListenerRegistry;
15
16
/**
17
 * This is a rule that checks a property on an entity in the code. 
18
 */
19
abstract class Property extends Schema {
20
    /**
21
     * @inheritdoc
22
     */
23 37
    public function fluid_interface(Def\RT $rt, $name, $mode, array $arguments) {
24 37
        $rt->throw_on_missing_var($name);
25 37
        $left = $rt->get_var($name);
26 37
        $rt->add_rule(new Rule($mode, $left, $this, $arguments));
27 36
    }
28
29
    /**
30
     * No listeners per default.
31
     *
32
     * @inheritdoc
33
     */
34 22
    public function register_listeners(ListenerRegistry $registry) {
35 22
    }
36
}
37