YetiForceCompany/YetiForceCRM

View on GitHub
app/RecordCollectors/PlVatPayerStatusVerification.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using undefined variables such as '$response' which will lead to PHP notices.
Open

                $response['fields'] = [

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$response' which will lead to PHP notices.
Open

        return $response;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$response' which will lead to PHP notices.
Open

            $response['error'] = $e->faultstring;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Missing class import via use statement (line '83', column '22').
Open

            if ($client = new \SoapClient($this->url, \App\RequestHttp::getSoapOptions())) {

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid assigning values to variables in if clauses and the like (line '83', column '8').
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid using static access to class '\App\RequestHttp' in method 'search'.
Open

            if ($client = new \SoapClient($this->url, \App\RequestHttp::getSoapOptions())) {

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 '\App\Log' in method 'search'.
Open

            \App\Log::warning($e->faultstring, 'RecordCollectors');

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

syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    protected string $addOnName = 'YetiForceRcPlVatPayerStatus';

Avoid variables with short names like $r. Configured minimum length is 3.
Open

                $r = $client->sprawdzNIP($vatNumber);

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Spaces must be used to indent lines; tabs are not allowed
Open

    public $displayType = 'Summary';

Spaces must be used to indent lines; tabs are not allowed
Open

        'Leads' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    public $description = 'LBL_PL_VAT_PAYER_DESC';

Spaces must be used to indent lines; tabs are not allowed
Open

        ],

Spaces must be used to indent lines; tabs are not allowed
Open

        ],

Spaces must be used to indent lines; tabs are not allowed
Open

            'vatNumber' => 'vat_id',

Spaces must be used to indent lines; tabs are not allowed
Open

        ],

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

    protected string $addOnName = 'YetiForceRcPlVatPayerStatus';

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$vatNumber) {

Spaces must be used to indent lines; tabs are not allowed
Open

                $r = $client->sprawdzNIP($vatNumber);

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

        'vatNumber' => [

Spaces must be used to indent lines; tabs are not allowed
Open

        'Competition' => [

Spaces must be used to indent lines; tabs are not allowed
Open

            'vatNumber' => 'vat_id',

Spaces must be used to indent lines; tabs are not allowed
Open

            return [];

Spaces must be used to indent lines; tabs are not allowed
Open

            $response['error'] = $e->faultstring;

Spaces must be used to indent lines; tabs are not allowed
Open

    public $icon = 'yfi-vat-pl';

Spaces must be used to indent lines; tabs are not allowed
Open

    public $docUrl = 'https://www.podatki.gov.pl/e-deklaracje/dokumentacja-it/';

Spaces must be used to indent lines; tabs are not allowed
Open

        ],

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $modulesFieldsMap = [

Spaces must be used to indent lines; tabs are not allowed
Open

        ],

Spaces must be used to indent lines; tabs are not allowed
Open

    public $label = 'LBL_PL_VAT_PAYER';

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $fields = [

Spaces must be used to indent lines; tabs are not allowed
Open

            'vatNumber' => 'vat_id',

Spaces must be used to indent lines; tabs are not allowed
Open

        'Vendors' => [

Spaces must be used to indent lines; tabs are not allowed
Open

                $response['fields'] = [

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        } catch (\SoapFault $e) {

Spaces must be used to indent lines; tabs are not allowed
Open

        return $response;

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $url = 'https://sprawdz-status-vat.mf.gov.pl/?wsdl';

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

        $vatNumber = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('vatNumber', 'Text'));

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            'labelModule' => '_Base',

Spaces must be used to indent lines; tabs are not allowed
Open

            'typeofdata' => 'V~M',

Spaces must be used to indent lines; tabs are not allowed
Open

            return [];

Spaces must be used to indent lines; tabs are not allowed
Open

            'vatNumber' => 'vat_id',

Spaces must be used to indent lines; tabs are not allowed
Open

        try {

Spaces must be used to indent lines; tabs are not allowed
Open

                ];

Spaces must be used to indent lines; tabs are not allowed
Open

    public $allowedModules = ['Accounts', 'Leads', 'Vendors', 'Competition'];

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

            'label' => 'Vat ID',

Spaces must be used to indent lines; tabs are not allowed
Open

    ];

Spaces must be used to indent lines; tabs are not allowed
Open

                    '' => $r->Komunikat

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$this->isActive()) {

Spaces must be used to indent lines; tabs are not allowed
Open

            \App\Log::warning($e->faultstring, 'RecordCollectors');

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string MF sever address */

Spaces must be used to indent lines; tabs are not allowed
Open

        'Accounts' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    public function search(): array

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($client = new \SoapClient($this->url, \App\RequestHttp::getSoapOptions())) {

There are no issues that match your filters.

Category
Status