Completed
Push — master ( 163fd9...314ef3 )
by Neomerx
02:36
created

Group   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 18 5
A parentGroup() 0 5 1
A createGroup() 0 6 1
1
<?php namespace Limoncello\Core\Routing;
2
3
/**
4
 * Copyright 2015-2016 [email protected] (www.neomerx.com)
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
/**
20
 * @package Limoncello\Core
21
 */
22
class Group extends BaseGroup
23
{
24
    /**
25
     * @param array $parameters
26
     */
27 20
    public function __construct(array $parameters = [])
28
    {
29
        list($middleware, $configurators, $factoryWasGiven, $requestFactory, $name) =
30 20
            $this->normalizeGroupParameters($parameters);
31
32 20
        if (empty($middleware) === false) {
33 1
            $this->setMiddleware($middleware);
34 1
        }
35 20
        if (empty($configurators) === false) {
36 2
            $this->setConfigurators($configurators);
37 2
        }
38 20
        if (empty($name) === false) {
39 1
            $this->setName($name);
40 1
        }
41 20
        if ($factoryWasGiven === true) {
42 7
            $this->setRequestFactory($requestFactory);
43 7
        }
44 20
    }
45
46
    /**
47
     * @return null
48
     */
49 13
    public function parentGroup()
50
    {
51
        // null
52 13
        return parent::parentGroup();
53
    }
54
55
    /**
56
     * @return NestedGroup
57
     */
58 12
    protected function createGroup()
59
    {
60 12
        $group = (new NestedGroup($this))->setHasTrailSlash($this->hasTrailSlash());
61
62 12
        return $group;
63
    }
64
}
65