Completed
Push — master ( 9a4fb7...cb90a4 )
by Chubarov
04:11
created

ConstructorUrl   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 42
ccs 19
cts 19
cp 1
rs 10
c 1
b 0
f 1
wmc 5
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A concatenationUrlCurl() 0 14 4
A guid() 0 12 1
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
    /**
14
     * Concatenation Url In Curl
15
     * @param $newParameters string
16
     * @return $this
17
     */
18 11
    protected function concatenationUrlCurl($newParameters)
19
    {
20 11
        if ($this->url  == '?') {
21 5
            $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...
22 11
        } elseif ($this->url == '') {
23 4
            $this->url .= $newParameters;
24 6
        } elseif ($this->url == '/') {
25 1
            $this->url .= $newParameters;
26 1
        }
27
        else {
28 2
            $this->url .= '&'.$newParameters;
29
        }
30 11
        return $this;
31
    }
32
33
    /**
34
     * Contains guid
35
     * @param $guid
36
     * @return $this
37
     */
38 7
    public function guid($guid)
39
    {
40 7
        $this->checkGuId($guid);
41 4
        $this->url      = '';
42 4
        $ParameterQuery = '(guid';
43 4
        $ParameterQuery.= "'";
44 4
        $ParameterQuery.= $guid;
45 4
        $ParameterQuery.= "'";
46 4
        $ParameterQuery.=')';
47
48 4
        return $this->concatenationUrlCurl($ParameterQuery);
49
    }
50
}