dofinity/pelecard

View on GitHub
src/Pelecard/CheckGoodParamX.php

Summary

Maintainability
A
35 mins
Test Coverage

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
Severity: Minor
Found in src/Pelecard/CheckGoodParamX.php - About 35 mins to fix

    Avoid using static access to class 'Pelecard\PelecardHttpRequest' in method 'execute'.
    Open

        $response = PelecardHttpRequest::pelecardPostRequest(self::CHECK_GOOD_PARAMX_URI, $this);
    Severity: Minor
    Found in src/Pelecard/CheckGoodParamX.php by phpmd

    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

       * @return: {"URL":"https://gateway20.pelecard.biz/PaymentGW?transactionId=5313aded-0b60-4bf3-9781-83d088b3c7c3","ConfirmationKey":"0c931d4cd8271f82f60a5c98be212f4a","Error":{"ErrCode":0}}
    Severity: Info
    Found in src/Pelecard/CheckGoodParamX.php by phan

    Visibility must be declared on method "__construct"
    Open

      function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {

    Opening brace of a class must be on the line after the definition
    Open

    class CheckGoodParamX implements \JsonSerializable {

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      private $user;

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $this->paramX = $paramX;

    Opening brace should be on a new line
    Open

      public function jsonSerialize() {

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }

    Opening brace should be on a new line
    Open

      function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      private $shvaSuccessOnly;

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      public function execute() {

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {

    Line indented incorrectly; expected at least 4 spaces, found 2
    Open

      const CHECK_GOOD_PARAMX_URI = 'services/CheckGoodParamX';

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      private $password;

    Opening brace should be on a new line
    Open

      public function execute() {

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        return json_decode($response);

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      private $paramX;

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $this->shvaSuccessOnly = $shvaSuccessOnly;

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $response = PelecardHttpRequest::pelecardPostRequest(self::CHECK_GOOD_PARAMX_URI, $this);

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $this->user = $user;

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      private $terminalNumber;

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      public function jsonSerialize() {

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        return get_object_vars($this);

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $this->terminalNumber = $terminalNumber;

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        $this->password = $password;

    There are no issues that match your filters.

    Category
    Status