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

JobName::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 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
}