Completed
Branch 2.0.0 (a6ce5f)
by Chubarov
06:30 queued 03:11
created

ConstructorUrl::guid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 1
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace agoalofalife\bpm\Assistants;
3
4
/**
5
 * Class ConstructorUrl
6
 *
7
 * @package agoalofalife\bpm\Assistants
8
 */
9
trait ConstructorUrl
10
{
11
    use VerifyValues;
12
    /**
13
     * Concatenation Url In Curl
14
     * @param $newParameters string
15
     * @return $this
16
     */
17
    protected function concatenationUrlCurl($newParameters)
18
    {
19
        if ($this->url  == '?') {
20
            $this->url .= $newParameters;
0 ignored issues
show
Bug introduced by
The property url does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21
        } elseif ($this->url == '') {
22
            $this->url .= $newParameters;
23
        } else {
24
            $this->url .= '&'.$newParameters;
25
        }
26
        return $this;
27
    }
28
29
    /**
30
     * Contains guid
31
     * @param $guid
32
     * @return $this
33
     */
34 View Code Duplication
    public function guid($guid)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
35
    {
36
        $this->checkGuId($guid);
37
        $this->url      = '';
38
        $ParameterQuery = '(guid';
39
        $ParameterQuery.= "'";
40
        $ParameterQuery.= $guid;
41
        $ParameterQuery.= "'";
42
        $ParameterQuery.=')';
43
44
        return $this->concatenationUrlCurl($ParameterQuery);
45
    }
46
}