YetiForceCompany/YetiForceCRM

View on GitHub
app/RecordCollectors/OrbIntelligence.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

Method search has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }
Severity: Minor
Found in app/RecordCollectors/OrbIntelligence.php - About 1 hr to fix

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

        public function search(): array
        {
            if (!$this->isActive()) {
                return [];
            }
    Severity: Minor
    Found in app/RecordCollectors/OrbIntelligence.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

    The method search() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
    Open

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

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

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

                $query['email'] = $mail;

    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 '$query' which will lead to PHP notices.
    Open

            $query['country'] = $country;

    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 '$query' which will lead to PHP notices.
    Open

                $query['phone'] = $phone;

    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 '$query' which will lead to PHP notices.
    Open

                $query['ein'] = $vatNumber;

    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 '$query' which will lead to PHP notices.
    Open

            $query['api_key'] = $this->apiKey;

    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 '$query' which will lead to PHP notices.
    Open

                $query['name'] = $name;

    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 '$query' which will lead to PHP notices.
    Open

            $this->getDataFromApi($query);

    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 '283', column '14').
    Open

                throw new \App\Exceptions\IllegalValue('You must fist setup Api Key in Config Panel', 403);

    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 using static access to class '\App\Json' in method 'getDataFromApi'.
    Open

            $data = isset($response) ? \App\Json::decode($response->getBody()->getContents()) : [];

    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 '280', column '8').
    Open

        private function loadConfig(): void
        {
            if (($params = $this->getParams()) && !empty($params['api_key'])) {
                $this->apiKey = $params['api_key'];
            } else {

    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\Utils' in method 'parseData'.
    Open

            return \App\Utils::flattenKeys($data, 'ucfirst');

    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 'getDataFromApi'.
    Open

                $this->data[$key] = $this->parseData(\App\Json::decode($response->getBody()->getContents()));

    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 'getDataFromApi'.
    Open

                    \App\Log::warning($e->getMessage(), '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

    Avoid using static access to class '\App\Log' in method 'getDataFromApi'.
    Open

                \App\Log::warning($e->getMessage(), '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

    The method loadConfig uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                throw new \App\Exceptions\IllegalValue('You must fist setup Api Key in Config Panel', 403);
            }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

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

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

            $client = \App\RequestHttp::getClient(['timeout' => 60]);

    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 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
    Open

        protected bool $paid = false;
    Severity: Critical
    Found in app/RecordCollectors/OrbIntelligence.php by phan

    Avoid excessively long variable names like $formFieldsToRecordMap. Keep variable name length under 20.
    Open

        public $formFieldsToRecordMap = [
            'Accounts' => [
                'name' => 'accountname',
                'eins0' => 'vat_id',
                'website' => 'website',

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

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

        public $label = 'LBL_ORB';

    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

        const LIMIT = 4;

    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

        public $icon = 'yfi-orb';

    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 $docUrl = 'https://api.orb-intelligence.com/';

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

        public $allowedModules = ['Accounts', 'Leads', 'Partners', '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

        public $description = 'LBL_ORB_DESC';

    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 $displayType = 'FillFields';

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

        /** @var int Limit for fetching companies */

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

                'addressZip' => 'addresslevel7a',

    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' => 'Other.RecordCollector',

    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

                'name' => 'vendorname',

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

                'name' => 'subject',

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

                'phone' => 'phone'

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

                'addressAddress2' => 'buildingnumbera',

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

                'name' => 'company',

    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

            'email' => [

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

            ]

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

                'country' => 'addresslevel1a',

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

        public $settingsFields = [

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

        public $formFieldsToRecordMap = [

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

                'email' => 'email1',

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

            'Partners' => [

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

                'eins0' => 'vat_id',

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

                'addressAddress1' => 'addresslevel8a',

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

                'addressCity' => 'addresslevel5a',

    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

            ],

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

            'phone' => [

    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

            'Accounts' => [

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

                'addressState' => 'addresslevel2a',

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

                'sic_code' => 'siccode',

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

                'addressZip' => 'addresslevel7a',

    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' => 'Phone',

    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' => 'vat_id',

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

                'email' => 'email1',

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

                'email' => 'email',

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

                'eins0' => 'vat_id',

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

                'phone' => 'phone',

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

                'addressAddress1' => 'addresslevel8a',

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

                'addressCity' => 'addresslevel5a',

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

                'description' => 'description',

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

                'addressAddress2' => 'buildingnumbera',

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

                'description' => 'description',

    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

                'label' => 'Email',

    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

                'phone' => 'phone'

    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

                'description' => 'description',

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

                'addressCity' => 'addresslevel5a',

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

                'eins0' => 'vat_id',

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

                'addressAddress1' => 'addresslevel8a',

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

                'cik' => 'registration_number_1',

    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

        ];

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

            'Partners' => [

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

        ];

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

                'cik' => 'registration_number_1',

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

                'website' => 'website',

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

                'email' => 'email',

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

                'addressAddress2' => 'buildingnumbera',

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

                'addressCountry' => 'addresslevel1a'

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

                'name' => 'company',

    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 bool $paid = false;

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

            'api_key' => ['required' => 1, 'purifyType' => 'Text', 'label' => 'LBL_API_KEY']

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

                'eins0' => 'vat_id',

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

                'email' => 'email',

    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

                'addressCountry' => 'addresslevel1a'

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

            ],

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

                'phone' => 'phone',

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

                'country' => 'addresslevel1a',

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

                'addressState' => 'addresslevel2a',

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

            ]

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

                'phone' => 'phone',

    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

        /** {@inheritdoc} */

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

                'addressAddress1' => 'addresslevel8a',

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

                'cik' => 'registration_number_1',

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

                'addressCountry' => 'addresslevel1a'

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

                'name' => 'subject',

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

                'addressZip' => 'addresslevel7a',

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

                'addressAddress1' => 'addresslevel8a',

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

                'addressCity' => 'addresslevel5a',

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

                'email' => 'email',

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

                'sic_code' => 'siccode',

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

                'addressCountry' => 'addresslevel1a'

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

                'email' => 'email',

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

                'addressAddress2' => 'buildingnumbera',

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

        /** @var string ORB Intelligence sever address */

    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

                'name' => 'subject',

    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

                'country' => 'addresslevel1a',

    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

        ];

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

                'addressState' => 'addresslevel2a',

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

                'addressZip' => 'addresslevel7a',

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

                'cik' => 'registration_number_1',

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

                'eins0' => 'vat_id',

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

                'addressZip' => 'addresslevel7a',

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

                'addressState' => 'addresslevel2a',

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

                'email' => 'email',

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

                'email' => 'email',

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

                'description' => 'description',

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

                'addressState' => 'addresslevel2a',

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

            ],

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

                'name' => 'vendorname',

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

                'name' => 'subject',

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

        protected $url = 'https://api.orb-intelligence.com/';

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

                'uitype' => 35

    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

                'name' => 'accountname',

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

                'email' => 'email',

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

                'phone' => 'phone'

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

                'country' => 'addresslevel1a',

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

                'website' => 'website',

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

                'website' => 'website',

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

                'addressAddress2' => 'buildingnumbera',

    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 $fields = [

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

            'name' => [

    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

                'label' => 'Account Name',

    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

        private $apiKey;

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

                'cik' => 'registration_number_1',

    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

                'email' => 'email',

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

                'phone' => 'phone',

    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

                'country' => 'addresslevel1a',

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

            ],

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

                'name' => 'accountname',

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

                'addressCity' => 'addresslevel5a',

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

                'addressCountry' => 'addresslevel1a'

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

                'description' => 'description',

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

            'country' => [

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

                'label' => 'Country',

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

                'label' => 'LBL_ORB_VAT',

    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

                'phone' => 'phone'

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

                'phone' => 'phone'

    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

        /** @var string Api Key. */

    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 = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('vatNumber', 'Text'));

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

                $query['phone'] = $phone;

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

            $data = \array_slice($data['results'], 0, self::LIMIT, true);

    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

         *

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

        }

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

            return parent::isActive() && ($params = $this->getParams()) && !empty($params['api_key']);

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

        }

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

         * Function fetching company data by params.

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

                $response = $client->get($this->url . '3/match/?' . http_build_query($query));

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

            foreach ($data as $key => $result) {

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

                $this->data[$key] = $this->parseData(\App\Json::decode($response->getBody()->getContents()));

    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 (($params = $this->getParams()) && !empty($params['api_key'])) {

    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

            $query['country'] = $country;

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

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

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

         * @return void

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

         * @param array $data

    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

        /** {@inheritdoc} */

    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

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

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

                } catch (\GuzzleHttp\Exception\GuzzleException $e) {

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

            $this->loadConfig();

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

                $query['email'] = $mail;

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

            $this->getDataFromApi($query);

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

            return $this->response;

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

                throw new \App\Exceptions\IllegalValue('You must fist setup Api Key in Config Panel', 403);

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

            return \App\Utils::flattenKeys($data, 'ucfirst');

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

        public function isActive(): bool

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

            $name = $this->request->getByType('name', 'Text');

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

            $phone = $this->request->getByType('phone', '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

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

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

            }

    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

        private function loadConfig(): void

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

            }

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

                $query['name'] = $name;

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

            }

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

         * @param array $query

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

            if (empty($data)) {

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

            $country = $this->request->getByType('country', 'Text');

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

            } elseif (empty($name) && !empty($phone)) {

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

         *

    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

        }

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

         * Function parsing data to fields from ORB Intelligence API.

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

            $mail = $this->request->getByType('email', 'Text');

    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

            } elseif (!empty($name)) {

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

            } elseif (empty($name) && !empty($mail)) {

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

        /**

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

            } else {

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

         *

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

            $response = [];

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

            } catch (\GuzzleHttp\Exception\GuzzleException $e) {

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

                $this->response['error'] = $e->getMessage();

    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

        {

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

            $query['api_key'] = $this->apiKey;

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

            if (!$country) {

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

            if ('United States' === $country && !empty($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

            }

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

                    $this->response['error'] = $e->getMessage();

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

         */

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

         * @return array

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

        private function parseData(array $data): 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

        }

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

            }

    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

            $this->loadData();

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

            $data = isset($response) ? \App\Json::decode($response->getBody()->getContents()) : [];

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

         * @return void

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

            $client = \App\RequestHttp::getClient(['timeout' => 60]);

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

         * Function setup Api Key.

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

        {

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

                $this->apiKey = $params['api_key'];

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

        {

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

                $query['ein'] = $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

        private function getDataFromApi(array $query): void

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

                    $response = $client->get($result['fetch_url']);

    There are no issues that match your filters.

    Category
    Status