This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Omnipay\FirstAtlanticCommerce\Message; |
||
4 | |||
5 | use Omnipay\Common\Exception\InvalidResponseException; |
||
6 | use Omnipay\Common\Message\RequestInterface; |
||
7 | use Omnipay\FirstAtlanticCommerce\Message\AbstractResponse; |
||
8 | |||
9 | /** |
||
10 | * FACPG2 Transaction Status Response |
||
11 | */ |
||
12 | View Code Duplication | class StatusResponse extends AbstractResponse |
|
0 ignored issues
–
show
|
|||
13 | { |
||
14 | /** |
||
0 ignored issues
–
show
|
|||
15 | * Constructor |
||
0 ignored issues
–
show
|
|||
16 | * |
||
0 ignored issues
–
show
|
|||
17 | * @param RequestInterface $request |
||
0 ignored issues
–
show
|
|||
18 | * @param string $data |
||
0 ignored issues
–
show
|
|||
19 | */ |
||
0 ignored issues
–
show
|
|||
20 | public function __construct(RequestInterface $request, $data) |
||
0 ignored issues
–
show
|
|||
21 | { |
||
0 ignored issues
–
show
|
|||
22 | if ( empty($data) ) { |
||
0 ignored issues
–
show
|
|||
23 | throw new InvalidResponseException(); |
||
0 ignored issues
–
show
|
|||
24 | } |
||
0 ignored issues
–
show
|
|||
25 | |||
26 | $this->request = $request; |
||
0 ignored issues
–
show
|
|||
27 | $this->data = $this->xmlDeserialize($data); |
||
0 ignored issues
–
show
$data is of type string , but the function expects a object<SimpleXMLElement> .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
28 | } |
||
0 ignored issues
–
show
|
|||
29 | |||
30 | /** |
||
0 ignored issues
–
show
|
|||
31 | * Return whether or not the response was successful |
||
0 ignored issues
–
show
|
|||
32 | * |
||
0 ignored issues
–
show
|
|||
33 | * @return boolean |
||
0 ignored issues
–
show
|
|||
34 | */ |
||
0 ignored issues
–
show
|
|||
35 | public function isSuccessful() |
||
0 ignored issues
–
show
|
|||
36 | { |
||
0 ignored issues
–
show
|
|||
37 | return isset($this->data['ResponseCode']) && '1' === $this->data['ResponseCode']; |
||
0 ignored issues
–
show
|
|||
38 | } |
||
0 ignored issues
–
show
|
|||
39 | |||
40 | /** |
||
0 ignored issues
–
show
|
|||
41 | * Return the response message |
||
0 ignored issues
–
show
|
|||
42 | * |
||
0 ignored issues
–
show
|
|||
43 | * @return string |
||
0 ignored issues
–
show
|
|||
44 | */ |
||
0 ignored issues
–
show
|
|||
45 | public function getMessage() |
||
0 ignored issues
–
show
|
|||
46 | { |
||
0 ignored issues
–
show
|
|||
47 | return isset($this->data['ReasonCodeDescription']) ? $this->data['ReasonCodeDescription'] : null; |
||
0 ignored issues
–
show
|
|||
48 | } |
||
0 ignored issues
–
show
|
|||
49 | |||
50 | /** |
||
0 ignored issues
–
show
|
|||
51 | * Return transaction reference |
||
0 ignored issues
–
show
|
|||
52 | * |
||
0 ignored issues
–
show
|
|||
53 | * @return string |
||
0 ignored issues
–
show
|
|||
54 | */ |
||
0 ignored issues
–
show
|
|||
55 | public function getTransactionReference() |
||
0 ignored issues
–
show
|
|||
56 | { |
||
0 ignored issues
–
show
|
|||
57 | return isset($this->data['ReferenceNumber']) ? $this->data['ReferenceNumber'] : null; |
||
0 ignored issues
–
show
|
|||
58 | } |
||
0 ignored issues
–
show
|
|||
59 | } |
||
60 |
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.