YetiForceCompany/YetiForceCRM

View on GitHub
app/YetiForce/Order.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method getFieldInstances has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFieldInstances(): array
    {
        $company = \App\Company::getCompany();
        $fields = [];
        foreach (self::COMPANY_FORM_FIELDS as $fieldName) {
Severity: Minor
Found in app/YetiForce/Order.php - About 1 hr to fix

    Function getFieldInstances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFieldInstances(): array
        {
            $company = \App\Company::getCompany();
            $fields = [];
            foreach (self::COMPANY_FORM_FIELDS as $fieldName) {
    Severity: Minor
    Found in app/YetiForce/Order.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid using static access to class '\App\Fields\Country' in method 'getFieldInstances'.
    Open

                        foreach (\App\Fields\Country::getAll() as $country) {
    Severity: Minor
    Found in app/YetiForce/Order.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

    Avoid using static access to class '\App\Json' in method 'send'.
    Open

    }
    Severity: Minor
    Found in app/YetiForce/Order.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

    Avoid using static access to class '\Settings_Vtiger_Field_Model' in method 'getFieldInstances'.
    Open

                $fields[$fieldName] = \Settings_Vtiger_Field_Model::init('Vtiger', $params);
    Severity: Minor
    Found in app/YetiForce/Order.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

    Avoid using static access to class '\App\Language' in method 'getFieldInstances'.
    Open

                            $params['picklistValues'][$country['name']] = \App\Language::translateSingleMod(
                                $country['name'],
                                'Other.Country'
                            );
    Severity: Minor
    Found in app/YetiForce/Order.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

    Avoid using static access to class '\App\Company' in method 'getFieldInstances'.
    Open

            $company = \App\Company::getCompany();
    Severity: Minor
    Found in app/YetiForce/Order.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

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

        public function send(): bool
        {
            $this->success = false;
            $client = new ApiClient();
            $client->send(self::URL, 'POST', ['form_params' => $this->getData()]);
    Severity: Minor
    Found in app/YetiForce/Order.php by phpmd

    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

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

        public ?string $error = null;
    Severity: Critical
    Found in app/YetiForce/Order.php by phan

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

        private ?string $id;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpmd

    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

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

        private function setId(string $id): self
    Severity: Minor
    Found in app/YetiForce/Order.php by phpmd

    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

    CASE statements must be defined using a colon
    Open

                    case 'city':
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'city',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                $params = [
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                            );
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                $fields[$fieldName] = \Settings_Vtiger_Field_Model::init('Vtiger', $params);
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $this->success = false;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Set product package ID.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private array $data = [];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'typeofdata' => 'V~M',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        $params['maximumlength'] = '100';
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        ];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'maximumlength' => '255',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $this->data[$key] = $value;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                $this->success = \in_array($code, [200, 201]) && $content;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function getId()
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $this->packageId = $packageId;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return self
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private function getData(): array
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'label' => 'LBL_' . strtoupper($fieldName),
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    case 'city':
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $this->id = $id;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return [
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'name',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'uitype' => 1,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'fieldvalue' => $company[$fieldName] ?? null,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'isEditableReadOnly' => false,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'name' => $fieldName,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Set value.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function send(): bool
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                $content = $client->getResponseBody();
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Get order ID.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @param string $id
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'vat_id',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var string Order ID */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Function determines fields available in payment view.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Send order data.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'vatId' => $this->data['vat_id'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'post_code',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                switch ($fieldName) {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'postCode' => $this->data['post_code'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public const URL = 'https://api.yetiforce.eu/registrations/orders';
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'country',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'displaytype' => 1,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                            $params['picklistValues'][$country['name']] = \App\Language::translateSingleMod(
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                                $country['name'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $fields;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Get last error.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'packageId' => $this->packageId,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            ];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private const COMPANY_FORM_FIELDS = [
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'column' => $fieldName,
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this->error ?? '';
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return string[]
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'country' => $this->data['country'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var string URL */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            'address',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Array of company form fields.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var string Last error. */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private bool $success;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $fields = [];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        $params['picklistValues'] = [];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                if ($this->success) {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $client->send(self::URL, 'POST', ['form_params' => $this->getData()]);
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $this->error = $client->getError();
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    $this->setId(\App\Json::decode($content)['id']);
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @param string $packageId
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return self
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var array Raw data */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return \Settings_Vtiger_Field_Model[]
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function getFieldInstances(): array
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $company = \App\Company::getCompany();
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                ];
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        $params['maximumlength'] = '100';
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        foreach (\App\Fields\Country::getAll() as $country) {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @param string $key
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @param mixed  $value
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var bool Response result */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            foreach (self::COMPANY_FORM_FIELDS as $fieldName) {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'purifyType' => \App\Purifier::TEXT
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                        $params['uitype'] = 16;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                                'Other.Country'
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            $client = new ApiClient();
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function getError(): string
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'company' => $this->data['name'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private ?string $id;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    default:
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            if (!$this->error && ($code = $client->getStatusCode())) {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this->success;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

            return $this->id ?? '';
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function setPackageId(string $packageId): self
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public ?string $error = null;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        /** @var Product package ID */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        public function set(string $key, $value)
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private function setId(string $id): self
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'city' => $this->data['city'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                'address' => $this->data['address'],
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        private string $packageId;
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    'presence' => '',
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

                    case 'country':
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * @return $this
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * set order ID.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         * Get registration data.
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/YetiForce/Order.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status