YetiForceCompany/YetiForceCRM

View on GitHub
app/RecordCollectors/DkCvr.php

Summary

Maintainability
A
2 hrs
Test Coverage
C
74%

Function getDataFromApi has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDataFromApi($params): void
    {
        $params['format'] = 'json';
        if (!empty($this->token)) {
            $params['token'] = $this->token;
Severity: Minor
Found in app/RecordCollectors/DkCvr.php - About 1 hr 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

Method getDataFromApi has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getDataFromApi($params): void
    {
        $params['format'] = 'json';
        if (!empty($this->token)) {
            $params['token'] = $this->token;
Severity: Minor
Found in app/RecordCollectors/DkCvr.php - About 1 hr to fix

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

        public function search(): array
        {
            $params = [];
            if ($vatNumber = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('vatNumber', 'Text'))) {
                $params['vat'] = $vatNumber;
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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

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

        private function setToken(): void
        {
            if (($params = $this->getParams()) && !empty($params['token'])) {
                $this->token = $params['token'];
            }
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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

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

        public function search(): array
        {
            $params = [];
            if ($vatNumber = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('vatNumber', 'Text'))) {
                $params['vat'] = $vatNumber;
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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

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

        public function search(): array
        {
            $params = [];
            if ($vatNumber = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('vatNumber', 'Text'))) {
                $params['vat'] = $vatNumber;
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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

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

                    $this->data = $this->parseData(\App\Json::decode($response->getBody()->getContents()));
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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\Log' in method 'getDataFromApi'.
    Open

                \App\Log::warning($e->getMessage(), 'RecordCollectors');
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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\Utils' in method 'parseData'.
    Open

            return \App\Utils::flattenKeys($data, 'ucfirst');
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.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

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

        protected string $addOnName = 'YetiForceRcDkCvr';
    Severity: Critical
    Found in app/RecordCollectors/DkCvr.php by phan

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

        public $formFieldsToRecordMap = [
            'Accounts' => [
                'name' => 'accountname',
                'vat' => 'vat_id',
                'phone' => 'phone',
    Severity: Minor
    Found in app/RecordCollectors/DkCvr.php by phpmd

    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

        /** {@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_DK_CVR_DESC';

    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

                'vat' => '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

        /** @var string CH sever address */

    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

                'fax' => 'fax',

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

                'productionunits0City' => 'addresslevel5a',

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

                'companydesc' => 'description',

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

                'vat' => 'vat_id',

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

                'industrydesc' => 'description',

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

                'fax' => 'fax',

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

                'industrydesc' => 'description',

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

                'productionunits0Zipcode' => 'addresslevel7a',

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

                'productionunits0Zipcode' => 'addresslevel7a',

    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

        public $label = 'LBL_DK_CVR';

    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

                'companydesc' => 'description',

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

                'address' => 'addresslevel8a',

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

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

                'industrydesc' => 'description',

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

                'address' => 'addresslevel8a',

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

                'city' => 'addresslevel5a',

    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

                'country' => 'addresslevel1a',

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

                'fax' => 'fax',

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

                'productionunits0Zipcode' => 'addresslevel7a',

    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

                'country' => 'addresslevel1a',

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

        public $icon = 'yfi-cvr-dk';

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

                'vat' => 'vat_id',

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

                'city' => '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

                'name' => 'vendorname',

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

                'zipcode' => 'addresslevel7a',

    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

                'productionunits0City' => 'addresslevel5a',

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

        const EXTERNAL_URL = 'https://cvrapi.dk/virksomhed/';

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

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

    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

                'vat' => '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

                'companydesc' => 'description',

    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

        public $settingsFields = [

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

                'productionunits0Address' => 'addresslevel8a',

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

                'productionunits0Zipcode' => 'addresslevel7a',

    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

                'address' => 'addresslevel8a',

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

                'address' => 'addresslevel8a',

    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

            'Leads' => [

    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

        public $docUrl = 'https://cvrapi.dk/documentation';

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

                'fax' => 'fax',

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

                'industrycode' => 'siccode',

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

                'productionunits0Address' => 'addresslevel8a',

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

                'zipcode' => 'addresslevel7a',

    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

                'name' => 'accountname',

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

                'zipcode' => 'addresslevel7a',

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

                'companydesc' => 'description',

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

                'productionunits0Address' => 'addresslevel8a',

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

                'city' => 'addresslevel5a',

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

                'city' => 'addresslevel5a',

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

                'vat' => '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

                '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

                'phone' => 'phone',

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

                'zipcode' => 'addresslevel7a',

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

                'productionunits0City' => 'addresslevel5a',

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

                'industrydesc' => 'description',

    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

                    'dk' => 'Denmark'

    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

                '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

            $this->loadData();

    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

                    if (isset($this->data['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

            'token' => ['required' => 0, 'purifyType' => 'Text', 'label' => 'LBL_API_KEY_OPTIONAL'],

    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

                'productionunits0Address' => 'addresslevel8a',

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

                'industrydesc' => 'description',

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

                'address' => 'addresslevel8a',

    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

        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

        private $token;

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

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

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

            if (!$this->isActive() && empty($params)) {

    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->token = $params['token'];

    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 ($this->data && empty($this->data['error'])) {

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

                        break;

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

                'productionunits0Address' => 'addresslevel8a',

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

                'picklistValues' => [

    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

            if ($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

         * @return 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

            'Accounts' => [

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

                'productionunits0City' => 'addresslevel5a',

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

                'companydesc' => 'description',

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

                'productionunits0Zipcode' => 'addresslevel7a',

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

                'uitype' => 16,

    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

            'Vendors' => [

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

         * @param array $params

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

                $response = \App\RequestHttp::getClient()->get($this->url . http_build_query($params));

    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

                    case 'dk':

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

                    default:

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

         *

    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

                'productionunits0City' => 'addresslevel5a',

    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

                $params['vat'] = $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

            try {

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

                        break;

    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

        protected string $addOnName = 'YetiForceRcDkCvr';

    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

            ],

    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

        public function search(): array

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

        private function setToken(): 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

        /** {@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

            ],

    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

         * Function setup token key.

    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

        private function getDataFromApi($params): void

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

            if (!empty($this->token)) {

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

                $params['token'] = $this->token;

    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

            'country' => [

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

                'label' => 'FL_COMPANY_NAME',

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

            $params = [];

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

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

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

            $this->getDataFromApi($params);

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

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

                'zipcode' => 'addresslevel7a',

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

                'city' => 'addresslevel5a',

    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

            $this->setToken();

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

                    case 'no':

    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 $data

    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

        /** {@inheritdoc} */

    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

         */

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

        {

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

            $params['format'] = 'json';

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

                    'no' => 'Norway',

    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

        private $url = 'http://cvrapi.dk/api?';

    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

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

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

                        $this->data['country'] = 'Norway';

    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

            '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

        /** @var string CH sever address */

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

        /** @var string Token key */

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

                $params['name'] = $name;

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

                $params['phone'] = $phone;

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

         * Function fetching company data by Company Number (CVR).

    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['links'][0] = self::EXTERNAL_URL . $params['country'] . '/' . urlencode(str_replace(' ', '-', $this->data['name'])) . '/' . urlencode($this->data['vat']);

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

    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

                if (200 === $response->getStatusCode()) {

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

                        break;

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

                        $this->data['country'] = 'Denmark';

    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

                'picklistModule' => 'Other.Country',

    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

            if ($phone = $this->request->getByType('phone', 'Text')) {

    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

         * @return void

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

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

    Line exceeds 120 characters; contains 190 characters
    Open

                        $this->response['links'][0] = self::EXTERNAL_URL . $params['country'] . '/' . urlencode(str_replace(' ', '-', $this->data['name'])) . '/' . urlencode($this->data['vat']);

    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 (\GuzzleHttp\Exception\GuzzleException $e) {

    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

                'fax' => 'fax',

    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

                'label' => 'FL_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

            }

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

                switch ($params['country']) {

    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 API.

    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

            if (($params = $this->getParams()) && !empty($params['token'])) {

    There are no issues that match your filters.

    Category
    Status