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\FirstAtlanticCommerce\Message\AbstractRequest; |
||
6 | |||
7 | /** |
||
8 | * FACPG2 Transaction Modification Request |
||
9 | */ |
||
10 | class TransactionModificationRequest extends AbstractRequest |
||
11 | { |
||
12 | /** |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
13 | * @var string; |
||
0 ignored issues
–
show
|
|||
14 | */ |
||
0 ignored issues
–
show
|
|||
15 | protected $requestName = 'TransactionModificationRequest'; |
||
0 ignored issues
–
show
|
|||
16 | |||
17 | /** |
||
0 ignored issues
–
show
|
|||
18 | * Modification Type |
||
0 ignored issues
–
show
|
|||
19 | * |
||
0 ignored issues
–
show
|
|||
20 | * @var int; |
||
0 ignored issues
–
show
|
|||
21 | */ |
||
0 ignored issues
–
show
|
|||
22 | protected $modificationType; |
||
0 ignored issues
–
show
|
|||
23 | |||
24 | /** |
||
0 ignored issues
–
show
|
|||
25 | * Validate and construct the data for the request |
||
0 ignored issues
–
show
|
|||
26 | * |
||
0 ignored issues
–
show
|
|||
27 | * @return array |
||
0 ignored issues
–
show
|
|||
28 | */ |
||
0 ignored issues
–
show
|
|||
29 | public function getData() |
||
0 ignored issues
–
show
|
|||
30 | { |
||
0 ignored issues
–
show
|
|||
31 | $this->validate('merchantId', 'merchantPassword', 'acquirerId', 'transactionId', 'amount'); |
||
0 ignored issues
–
show
|
|||
32 | |||
33 | $data = [ |
||
0 ignored issues
–
show
|
|||
34 | 'AcquirerId' => $this->getAcquirerId(), |
||
0 ignored issues
–
show
|
|||
35 | 'Amount' => $this->formatAmount(), |
||
0 ignored issues
–
show
|
|||
36 | 'CurrencyExponent' => $this->getCurrencyDecimalPlaces(), |
||
0 ignored issues
–
show
|
|||
37 | 'MerchantId' => $this->getMerchantId(), |
||
0 ignored issues
–
show
|
|||
38 | 'ModificationType' => $this->getModificationType(), |
||
0 ignored issues
–
show
|
|||
39 | 'OrderNumber' => $this->getTransactionId(), |
||
0 ignored issues
–
show
|
|||
40 | 'Password' => $this->getMerchantPassword() |
||
0 ignored issues
–
show
|
|||
41 | ]; |
||
0 ignored issues
–
show
|
|||
42 | |||
43 | return $data; |
||
0 ignored issues
–
show
|
|||
44 | } |
||
0 ignored issues
–
show
|
|||
45 | |||
46 | /** |
||
0 ignored issues
–
show
|
|||
47 | * Returns endpoint for authorize requests |
||
0 ignored issues
–
show
|
|||
48 | * |
||
0 ignored issues
–
show
|
|||
49 | * @return string Endpoint URL |
||
0 ignored issues
–
show
|
|||
50 | */ |
||
0 ignored issues
–
show
|
|||
51 | protected function getEndpoint() |
||
0 ignored issues
–
show
|
|||
52 | { |
||
0 ignored issues
–
show
|
|||
53 | return parent::getEndpoint() . 'TransactionModification'; |
||
0 ignored issues
–
show
|
|||
54 | } |
||
0 ignored issues
–
show
|
|||
55 | |||
56 | /** |
||
0 ignored issues
–
show
|
|||
57 | * Returns the modification type |
||
0 ignored issues
–
show
|
|||
58 | * |
||
0 ignored issues
–
show
|
|||
59 | * @return int Modification Type |
||
0 ignored issues
–
show
|
|||
60 | */ |
||
0 ignored issues
–
show
|
|||
61 | protected function getModificationType() |
||
0 ignored issues
–
show
|
|||
62 | { |
||
0 ignored issues
–
show
|
|||
63 | return $this->modificationType; |
||
0 ignored issues
–
show
|
|||
64 | } |
||
0 ignored issues
–
show
|
|||
65 | |||
66 | /** |
||
0 ignored issues
–
show
|
|||
67 | * Return the transaction modification response object |
||
0 ignored issues
–
show
|
|||
68 | * |
||
0 ignored issues
–
show
|
|||
69 | * @param \SimpleXMLElement $xml Response xml object |
||
0 ignored issues
–
show
|
|||
70 | * |
||
0 ignored issues
–
show
|
|||
71 | * @return ResponseInterface |
||
0 ignored issues
–
show
|
|||
72 | */ |
||
0 ignored issues
–
show
|
|||
73 | protected function newResponse($xml) |
||
0 ignored issues
–
show
|
|||
74 | { |
||
0 ignored issues
–
show
|
|||
75 | return new TransactionModificationResponse($this, $xml); |
||
0 ignored issues
–
show
The return type of
return new \Omnipay\Firs...nResponse($this, $xml); (Omnipay\FirstAtlanticCom...ionModificationResponse ) is incompatible with the return type declared by the abstract method Omnipay\FirstAtlanticCom...actRequest::newResponse of type Omnipay\FirstAtlanticCom...ssage\ResponseInterface .
If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design. Let’s take a look at an example: class Author {
private $name;
public function __construct($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
abstract class Post {
public function getAuthor() {
return 'Johannes';
}
}
class BlogPost extends Post {
public function getAuthor() {
return new Author('Johannes');
}
}
class ForumPost extends Post { /* ... */ }
function my_function(Post $post) {
echo strtoupper($post->getAuthor());
}
Our function ![]() |
|||
76 | } |
||
0 ignored issues
–
show
|
|||
77 | } |
||
78 |