Passed
Pull Request — master (#23)
by Volodymyr
48:37
created

GetSecurityInvoiceResponseContainer::__toString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
c 0
b 0
f 0
rs 9.9
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Payone\Business\Api\Response\Container;
9
10 View Code Duplication
class GetSecurityInvoiceResponseContainer extends AbstractResponseContainer
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $response;
16
17
    /**
18
     * @param string $response
19
     *
20
     * @return void
21
     */
22
    public function setResponse($response)
23
    {
24
        $this->response = $response;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getResponse()
31
    {
32
        return $this->response;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function __toString()
39
    {
40
        if ($this->isError()) {
41
            $result = parent::__toString();
42
        } else {
43
            $stringArray = ['status=' . $this->getStatus(), 'data=PDF-Content'];
44
            $result = implode('|', $stringArray);
45
        }
46
47
        return $result;
48
    }
49
}
50