src/Pelecard/CheckGoodParamX.php
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
Avoid using static access to class 'Pelecard\PelecardHttpRequest' in method 'execute'. Open
Open
$response = PelecardHttpRequest::pelecardPostRequest(self::CHECK_GOOD_PARAMX_URI, $this);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Saw unextractable annotation for comment '* @return: {"URL":"https://gateway20.pelecard.biz/PaymentGW?transactionId=5313aded-0b60-4bf3-9781-83d088b3c7c3","ConfirmationKey":"0c931d4cd8271f82f60a5c98be212f4a","Error":{"ErrCode":0}}'
Open
Open
* @return: {"URL":"https://gateway20.pelecard.biz/PaymentGW?transactionId=5313aded-0b60-4bf3-9781-83d088b3c7c3","ConfirmationKey":"0c931d4cd8271f82f60a5c98be212f4a","Error":{"ErrCode":0}}
- Exclude checks
Visibility must be declared on method "__construct" Open
Open
function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class CheckGoodParamX implements \JsonSerializable {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
private $user;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$this->paramX = $paramX;
- Exclude checks
Opening brace should be on a new line Open
Open
public function jsonSerialize() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Opening brace should be on a new line Open
Open
function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
private $shvaSuccessOnly;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
public function execute() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
const CHECK_GOOD_PARAMX_URI = 'services/CheckGoodParamX';
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
private $password;
- Exclude checks
Opening brace should be on a new line Open
Open
public function execute() {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
return json_decode($response);
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
private $paramX;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$this->shvaSuccessOnly = $shvaSuccessOnly;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$response = PelecardHttpRequest::pelecardPostRequest(self::CHECK_GOOD_PARAMX_URI, $this);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$this->user = $user;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
private $terminalNumber;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
public function jsonSerialize() {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
return get_object_vars($this);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$this->terminalNumber = $terminalNumber;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
$this->password = $password;
- Exclude checks