Route   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 77
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetExists() 0 3 1
A offsetGet() 0 3 2
A offsetSet() 0 3 1
A offsetUnset() 0 5 2
1
<?php
2
/**
3
 * This file is part of the Drest package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author Lee Davis
9
 * @copyright Copyright (c) Lee Davis <@leedavis81>
10
 * @link https://github.com/leedavis81/drest/blob/master/LICENSE
11
 * @license http://opensource.org/licenses/MIT The MIT X License (MIT)
12
 */
13
namespace Drest\Mapping\Annotation;
14
15
/**
16
 * @Annotation
17
 * @Target("ANNOTATION")
18
 */
19
final class Route implements \ArrayAccess
20
{
21
22
    /** @var string */
23
    public $name;
24
25
    /** @var string */
26
    public $content;
27
28
    /** @var string */
29
    public $routePattern;
30
31
    /** @var array */
32
    public $routeConditions;
33
34
    /** @var string */
35
    public $action;
36
37
    /** @var array */
38
    public $verbs;
39
40
    /** @var array */
41
    public $expose;
42
43
    /** @var boolean */
44
    public $disableExpose;
45
46
    /** @var boolean */
47
    public $allowOptions;
48
49
    /** @var boolean */
50
    public $collection;
51
52
    /** @var boolean */
53
    public $origin;
54
55
    /**
56
     * Return key exists.
57
     *
58
     * @param mixed $offset
59
     * @return boolean
60
     */
61 44
    public function offsetExists($offset) {
62 44
        return isset($this->$offset);
63
    }
64
65
    /**
66
     * Return the value for the offset.
67
     *
68
     * @param mixed $offset
69
     * @return mixed
70
     */
71 44
    public function offsetGet($offset) {
72 44
        return $this->offsetExists($offset) ? $this->$offset : null;
73
    }
74
75
    /**
76
     * Set the offset
77
     *
78
     * @param mixed $offset
79
     * @param mixed $value
80
     */
81 43
    public function offsetSet($offset, $value) {
82 43
        $this->$offset = $value;
83 43
    }
84
85
    /**
86
     * Unset the offset.
87
     *
88
     * @param mixed $offset
89
     */
90 1
    public function offsetUnset($offset) {
91 1
        if($this->offsetExists($offset)) {
92 1
            unset($this->$offset);
93 1
        }
94 1
    }
95
}
96