Completed
Push — master ( ec1ffe...1f9c3e )
by Ryota
02:11
created

JobName   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getQueueName() 0 7 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: polidog
5
 * Date: 2016/03/14
6
 */
7
8
namespace Tavii\SQSJobQueue\Job;
9
10
11
final class JobName
12
{
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @var string
20
     */
21
    private $prefix;
22
23
    /**
24
     * JobName constructor.
25
     * @param string $name
26
     * @param string $prefix
27
     * @param string $separator
0 ignored issues
show
Bug introduced by
There is no parameter named $separator. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
28
     */
29
    public function __construct($name, $prefix)
30
    {
31
        $this->name = $name;
32
        $this->prefix = $prefix;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getQueueName()
39
    {
40
        if (empty($this->prefix)) {
41
            return $this->name;
42
        }
43
        return $this->prefix . "_" . $this->name;
44
    }
45
}