Avoid using static access to class 'Pelecard\PelecardHttpRequest' in method 'SubmitPaymentRequest'. Open
return PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_INIT_URI, $this->PaymentRequest);
- 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
Avoid using static access to class 'Pelecard\PelecardHttpRequest' in method 'ValidatePayment'. Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- 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
Returning type false
but ValidatePayment()
is declared to return string
Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
Saw an @param annotation for PaymentRequest,
but it was not found in the param list of function setPaymentResponse($PaymentResponse)
Open
* @param \Pelecard\PaymentRespnse $PaymentRequest
- Exclude checks
Saw unextractable annotation for comment '* @return: {"URL":"https://gateway20.pelecard.biz/PaymentGW?transactionId=5313aded-0b60-4bf3-9781-83d088b3c7c3","ConfirmationKey":"0c931d4cd8271f82f60a5c98be212f4a","Error":{"ErrCode":0}}'
Open
* @return: {"URL":"https://gateway20.pelecard.biz/PaymentGW?transactionId=5313aded-0b60-4bf3-9781-83d088b3c7c3","ConfirmationKey":"0c931d4cd8271f82f60a5c98be212f4a","Error":{"ErrCode":0}}
- Exclude checks
Returning type true
but ValidatePayment()
is declared to return string
Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
The parameter $PaymentResponse is not named in camelCase. Open
public function setPaymentResponse($PaymentResponse) {
$this->PaymentResponse = $PaymentResponse;
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $PaymentRequest is not named in camelCase. Open
public function setPaymentRequest($PaymentRequest) {
$this->PaymentRequest = $PaymentRequest;
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Method name "PelecardPayment::ValidatePayment" is not in camel caps format Open
public function ValidatePayment() {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
Opening brace of a class must be on the line after the definition Open
class PelecardPayment {
- Exclude checks
Method name "PelecardPayment::SubmitPaymentRequest" is not in camel caps format Open
public function SubmitPaymentRequest() {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
Opening brace should be on a new line Open
public function ValidatePayment() {
- Exclude checks
Opening brace should be on a new line Open
public function SubmitPaymentRequest() {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
const PAYMENT_VALIDATE_URI = 'PaymentGW/ValidateByUniqueKey';
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
public function setPaymentRequest($PaymentRequest) {
- Exclude checks
Opening brace should be on a new line Open
public function setPaymentRequest($PaymentRequest) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
public function SubmitPaymentRequest() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
const PAYMENT_INIT_URI = 'PaymentGW/init';
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_INIT_URI, $this->PaymentRequest);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$this->PaymentRequest = $PaymentRequest;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Opening brace should be on a new line Open
public function setPaymentResponse($PaymentResponse) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
public function setPaymentResponse($PaymentResponse) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private $PaymentRequest;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private $PaymentResponse;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$this->PaymentResponse = $PaymentResponse;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
public function ValidatePayment() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
The variable $PaymentResponse is not named in camelCase. Open
public function setPaymentResponse($PaymentResponse) {
$this->PaymentResponse = $PaymentResponse;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $PaymentRequest is not named in camelCase. Open
public function setPaymentRequest($PaymentRequest) {
$this->PaymentRequest = $PaymentRequest;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method SubmitPaymentRequest is not named in camelCase. Open
public function SubmitPaymentRequest() {
return PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_INIT_URI, $this->PaymentRequest);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method ValidatePayment is not named in camelCase. Open
public function ValidatePayment() {
return !empty(PelecardHttpRequest::pelecardPostRequest(self::PAYMENT_VALIDATE_URI, $this->PaymentResponse->getValidationRequestStruct())) ? TRUE : FALSE;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}