GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 3.0 ( 6209fa...31a631 )
by Szurovecz
04:34 queued 02:00
created

ConfigurationBuilder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A withMethod() 0 5 1
A getConfigMap() 0 4 1
A build() 0 4 1
1
<?php
2
/*
3
 * Copyright (c) 2014 Janos Szurovecz
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6
 * this software and associated documentation files (the "Software"), to deal in
7
 * the Software without restriction, including without limitation the rights to
8
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
 * of the Software, and to permit persons to whom the Software is furnished to do
10
 * so, subject to the following conditions:
11
 *
12
 * The above copyright notice and this permission notice shall be included in all
13
 * copies or substantial portions of the Software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
 * SOFTWARE.
22
 */
23
24
namespace predaddy\messagehandling\configuration;
25
26
use predaddy\messagehandling\MessageBus;
27
28
/**
29
 * Builder for {@link Configuration} class.
30
 *
31
 * @package predaddy\messagehandling\configuration
32
 * @author Janos Szurovecz <[email protected]>
33
 */
34
final class ConfigurationBuilder
35
{
36
    private $configMap = [];
37
38
    public function __construct()
39
    {
40
    }
41
42
    /**
43
     * @param string $class FQCN
44
     * @param string $methodName
45
     * @param int $priority
46
     * @return $this
47
     */
48
    public function withMethod($class, $methodName, $priority = MessageBus::DEFAULT_PRIORITY)
49
    {
50
        $this->configMap[trim($class, '\\')][] = new MethodConfiguration($methodName, $priority);
51
        return $this;
52
    }
53
54
    /**
55
     * @return array
56
     */
57
    public function getConfigMap()
58
    {
59
        return $this->configMap;
60
    }
61
62
    /**
63
     * @return Configuration
64
     */
65
    public function build()
66
    {
67
        return new Configuration($this);
68
    }
69
}
70