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

JobCollection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 51
ccs 4
cts 10
cp 0.4
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 1
A getJobs() 0 4 1
A toArray() 0 11 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\JobClass as Job;
17
18
/**
19
 * Job Collection class
20
 *
21
 * @since 2.3.1
22
 */
23
class JobCollection
24
{
25
    /**
26
     * @var array
27
     *
28
     * All jobs from worker
29
     */
30
    private $workerJobs = array();
31
32
    /**
33
     * Adds into $workerJobs a Job instance
34
     * Return self object
35
     *
36
     * @param Job $workJob Class to add into array
37
     *
38
     * @return JobCollection
39
     */
40
    public function add(Job $workJob)
41
    {
42
        $this->workerJobs[] = $workJob;
43
44
        return $this;
45
    }
46
47
    /**
48
     * Retrieve all Jobs added previously
49
     *
50
     * @return array
51
     */
52
    public function getJobs()
53
    {
54
        return $this->workerJobs;
55
    }
56
57
    /**
58
     * Retrieve all jobs loaded previously in cache format
59
     *
60
     * @return array
61
     */
62 3
    public function toArray()
63
    {
64 3
        $jobs = array();
65
66 3
        foreach ($this->workerJobs as $job) {
67
68
            $jobs[] = $job->toArray();
69
        }
70
71 3
        return $jobs;
72
    }
73
}
74