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
Pull Request — master (#158)
by Bernardo Vieira da
12:24
created

WorkerCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 40
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 1
A toArray() 0 10 2
1
<?php
2
3
/**
4
 * Gearman Bundle for Symfony2
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * Feel free to edit as you please, and have fun.
10
 *
11
 * @author Marc Morera <[email protected]>
12
 */
13
14
namespace Mmoreram\GearmanBundle\Module;
15
16
use Mmoreram\GearmanBundle\Module\WorkerClass as Worker;
17
18
/**
19
 * WorkerCollection class
20
 *
21
 * @since 2.3.1
22
 */
23
class WorkerCollection
24
{
25
    /**
26
     * All Workers
27
     *
28
     * @var array
29
     */
30
    private $workerClasses = array();
31
32
    /**
33
     * Adds a Worker into $workerClasses
34
     * Return self object
35
     *
36
     * @param Worker $workerClass Worker element to add
37
     *
38
     * @return WorkerCollection
39
     */
40
    public function add(Worker $workerClass)
41
    {
42
        $this->workerClasses[] = $workerClass;
43
44
        return $this;
45
    }
46
47
    /**
48
     * Retrieve all workers loaded previously in cache format
49
     *
50
     * @return array
51
     */
52 1
    public function toArray()
53
    {
54 1
        $workersDumped = array();
55
56 1
        foreach ($this->workerClasses as $worker) {
57
            $workersDumped[] = $worker->toArray();
58
        }
59
60 1
        return $workersDumped;
61
    }
62
}
63