YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/SMSProvider/SMSAPI.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

The class SMSAPI has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
Open

class SMSAPI extends Provider
{
    /** {@inheritdoc} */
    protected $name = 'SMSAPI';

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '190', column '21').
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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

The method sendSMS has a boolean flag argument $useBackup, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function sendSMS(bool $useBackup = false): bool

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getUrl has a boolean flag argument $useBackup, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getUrl(bool $useBackup = false): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method send has a boolean flag argument $useBackup, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function send(bool $useBackup = false): bool

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method sendMMS has a boolean flag argument $useBackup, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function sendMMS(bool $useBackup = false): bool

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

Missing class import via use statement (line '216', column '21').
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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

            \App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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_Module_Model' in method 'getEditViewUrl'.
Open

        $model = \Settings_Vtiger_Module_Model::getInstance('Settings:SMSNotifier');

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\RequestHttp' in method 'sendSMS'.
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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\Fields\File' in method 'sendByRecord'.
Open

                $file = \App\Fields\File::loadFromPath($attach['path']);

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

            \App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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 '\Vtiger_Field_Model' in method 'getFieldInstanceByName'.
Open

        return $field ? \Vtiger_Field_Model::init($moduleName, $field, $name) : null;

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

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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\Completions' in method 'setMessage'.
Open

        $message = \App\Utils\Completions::decodeEmoji($message);

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

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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\RequestHttp' in method 'sendMMS'.
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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

            \App\Log::error($e->__toString());

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\TextUtils' in method 'getSubject'.
Open

        return \App\TextUtils::textTruncate(trim(strip_tags($this->get('message'))), 20) ?: $this->get('from');

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\Fields\File' in method 'getSmil'.
Open

            $image['body'] = '<img src="' . \App\Fields\File::getImageBaseData($file->getPath()) . '" region="Image"/>';

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

        $this->responseData = \App\Json::decode($this->response->getBody()) ?? [];

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

            \App\Log::error($e->__toString());

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\Config' in method 'getCallBackUrlByService'.
Open

        $callBackUrl = \App\Config::main('site_URL') . 'webservice.php?';

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

        if ($image && !\App\Json::isEmpty($image)) {

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_WebserviceApps_Record_Model' in method 'getCallBackUrlByService'.
Open

        $server = \Settings_WebserviceApps_Record_Model::getInstanceById($serviceId);

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

            foreach (\App\Json::decode($image) as $attach) {

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

Define a constant instead of duplicating this literal "region" 5 times.
Open

        $image = $msg = ['region' => '', 'body' => ''];

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "message" 7 times.
Open

        return ['to', 'idx', 'from', 'message'];

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Rename "$response" which has the same name as the field declared at line 42.
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

Noncompliant Code Example

class Foo {
  public $myField;

  public function doSomething() {
    $myField = 0;
    ...
  }
}

See

Define a constant instead of duplicating this literal "POST|" 4 times.
Open

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "SMSNotifier" 4 times.
Open

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "contents" 4 times.
Open

            ['name' => 'format', 'contents' => $this->format],

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Rename "$response" which has the same name as the field declared at line 42.
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

Noncompliant Code Example

class Foo {
  public $myField;

  public function doSomething() {
    $myField = 0;
    ...
  }
}

See

Define a constant instead of duplicating this literal "api_key" 3 times.
Open

        foreach (['api_key', 'from'] as $fieldName) {

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "uitype" 3 times.
Open

        $field = ['uitype' => 16, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Call to method endProfile from undeclared class \App\Log
Open

            \App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

        $apiKey = \App\Encryption::getInstance()->decrypt($server->get('api_key'));
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method error from undeclared class \App\Log
Open

            \App\Log::error($e->__toString());
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method beginProfile from undeclared class \App\Log
Open

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method beginProfile from undeclared class \App\Log
Open

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Argument 2 (callback) is Closure():'' but \preg_replace_callback() takes callable(array):string
Open

        $phoneNumber = preg_replace_callback('/[^\d]/s', function () {

Call to method __construct from undeclared class \GuzzleHttp\Client
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Returning type null but getFieldInstanceByName() is declared to return \Vtiger_Field_Model
Open

        return $field ? \Vtiger_Field_Model::init($moduleName, $field, $name) : null;

Parameter $response has undeclared type \GuzzleHttp\Psr7\Response
Open

    public function setResponse($response): self

Call to method error from undeclared class \App\Log
Open

            \App\Log::error($e->__toString());
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method __construct from undeclared class \GuzzleHttp\Client
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method request from undeclared class \GuzzleHttp\Client
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Property \App\Integrations\SMSProvider\SMSAPI->response has undeclared type \GuzzleHttp\Psr7\Response
Open

    private $response;

Call to method request from undeclared class \GuzzleHttp\Client
Open

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method getBody from undeclared class \GuzzleHttp\Psr7\Response
Open

        $this->responseData = \App\Json::decode($this->response->getBody()) ?? [];
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method getStatusCode from undeclared class \GuzzleHttp\Psr7\Response
Open

        return $this->response && 200 === $this->response->getStatusCode() && empty($this->responseData['error']);
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Declaration of function setPhone(string $phoneNumber) : \App\Integrations\SMSProvider\SMSAPI should be compatible with function setPhone(string $phoneNumber) : \App\Integrations\SMSProvider\Provider (method returning '\App\Integrations\SMSProvider\SMSAPI' cannot override method returning '\App\Integrations\SMSProvider\Provider') defined in /code/app/Integrations/SMSProvider/Provider.php:115
Open

    public function setPhone(string $phoneNumber): self
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method decodeEmoji from undeclared class \App\Utils\Completions
Open

        $message = \App\Utils\Completions::decodeEmoji($message);
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Call to method endProfile from undeclared class \App\Log
Open

            \App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
Severity: Critical
Found in app/Integrations/SMSProvider/SMSAPI.php by phan

Terminating statement must be indented to the same level as the CASE body
Open

                    break;

Terminating statement must be indented to the same level as the CASE body
Open

                    break;

Terminating statement must be indented to the same level as the CASE body
Open

                    break;

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

    /** @var string Address URL for MMS */

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

    /** {@inheritdoc} */

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

    protected $name = 'SMSAPI';

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

    public $format = 'json';

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

    private $attach = [];

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

     * @return string[]

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

    public function getRequiredParams(): array

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

    public function setResponse($response): self

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

        $this->response = $response;

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 string $phoneNumber

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

    {

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

                'headers' => $this->getHeaders(),

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 $this->isSuccess();

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

    /** @var string Backup address URL */

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

    protected $mmsUrl = 'https://api.smsapi.pl/mms.do';

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

        return $this;

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

        return $this->response && 200 === $this->response->getStatusCode() && empty($this->responseData['error']);

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

        $phoneNumber = preg_replace_callback('/[^\d]/s', function () {

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 $params;

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

            \App\Log::error($e->__toString());

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

     * @param \GuzzleHttp\Psr7\Response $response

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

    public function isSuccess(): bool

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

     */

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

            $uri = $this->getUrl($useBackup);

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::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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

     * Function to get service URL.

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

     * @return $this

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

        $this->set('to', $phoneNumber);

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

            'format' => $this->format

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

        foreach ($this->getRequiredParams() as $key) {

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

            if ('' !== $this->get($key)) {

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

            ['name' => 'subject', 'contents' => $this->getSubject()]

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

    }

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

    /** {@inheritdoc} */

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

    protected $url = 'https://api.smsapi.pl/sms.do';

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

    protected $urlBackup = 'https://api2.smsapi.pl/sms.do';

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

    /** @var array Response body */

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

    {

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

    public function setPhone(string $phoneNumber): self

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 $this->sendMMS($useBackup);

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

        return $this->sendSMS($useBackup);

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

     * @param bool $useBackup

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

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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

    protected $mmsUrlBackup = 'https://api2.smsapi.pl/mms.do';

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 $useBackup ? $this->urlBackup : $this->url;

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

     * @return self

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->responseData = \App\Json::decode($this->response->getBody()) ?? [];

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 getMMSBody(): array

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

    /** {@inheritdoc} */

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

        if ($this->attach || mb_strlen($this->get('message')) >= 670) {

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 Format */

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

    /** @var array Attachments */

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

        return ['to', 'idx', 'from', 'message'];

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 bool

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

    /** @var string Backup address URL for MMS */

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

    private $responseData;

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

     * Required fields.

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

    /**

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

    {

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

    }

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

        } catch (\Throwable $e) {

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

        }, $phoneNumber);

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

        foreach (['to', 'idx'] as $key) {

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

        return $params;

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

    public function sendSMS(bool $useBackup = false): bool

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

                'json' => $this->getBody()

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

    public function getUrl(bool $useBackup = false): string

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

        return $this;

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

     * Get body data.

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

     * Get body data for MMS.

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

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

     * Send SMS.

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 string

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 string $message

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 getBody(): array

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

    public function send(bool $useBackup = false): bool

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->setResponse($response);

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->setResponse($response);

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

    public function sendByRecord(\Vtiger_Record_Model $recordModel): bool

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

            foreach (\App\Json::decode($image) as $attach) {

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

                    $field['purifyType'] = \App\Purifier::ALNUM;

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

        return $field ? \Vtiger_Field_Model::init($moduleName, $field, $name) : null;

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 bool $useBackup

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

     * Set response.

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

     * Check if the message was sent successfully.

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

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

    public function setMessage(string $message): self

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[$key] = $this->get($key);

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

            ['name' => 'format', 'contents' => $this->format],

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

        }

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

            $uri = $useBackup ? $this->mmsUrlBackup : $this->mmsUrl;

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

            \App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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

        return $this;

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

     * @return string

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

            $recordModel->set('msgid', $this->responseData['list'][0]['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

    /**

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

                    $field['fieldvalue'] = $this->has($name) ? $this->get($name) : '';

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

        $model = \Settings_Vtiger_Module_Model::getInstance('Settings:SMSNotifier');

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

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

    }

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

        $image = $msg = ['region' => '', 'body' => ''];

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

            $msg['region'] = '<region id="Text" height="100%" width="100%" fit="scroll"/>';

Line exceeds 120 characters; contains 125 characters
Open

            $msg['body'] = '<text src="data:text/plain;base64,' . base64_encode($this->get('message')) . '" region="Text"/>';

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

        $fields = [];

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

                    $field['fieldvalue'] = $this->has($name) ? $this->get($name) : '';

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

     * Function to get Edit view url.

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

    /** @var string Encoding */

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

    private $response;

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

     * Set phone number.

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

     *

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

            'encoding' => $this->encoding,

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

            $params[] = ['name' => $key, 'contents' => $this->get($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

    {

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

    /**

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

    public function sendMMS(bool $useBackup = false): bool

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

     *

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

     * Get subject for MMS.

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

    {

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

     * Callback service URL.

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

    public $encoding = 'utf-8';

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

    }

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

        $message = \App\Utils\Completions::decodeEmoji($message);

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

     * @return bool

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

            return false;

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 \App\TextUtils::textTruncate(trim(strip_tags($this->get('message'))), 20) ?: $this->get('from');

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

     * @return string

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

                    break;

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

                    $field['uitype'] = 1;

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

            }

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

                'multipart' => $this->getMMSBody()

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

        } catch (\Throwable $e) {

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

     */

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

    public function getSubject(): string

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

        $this->setMessage($recordModel->get('message'));

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

        if ($result && !empty($this->responseData['list'][0]['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

        $moduleName = 'Settings:SMSNotifier';

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 string Url

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

    public function getEditViewUrl(): string

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

     * @param bool $useBackup

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

        $this->attach[] = $file;

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

        foreach ($this->attach as $file) {

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->addAttachment($file);

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

     *

Line exceeds 120 characters; contains 161 characters
Open

        $field = ['uitype' => 16, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

        return "index.php?module={$model->getName()}&parent={$model->getParentName()}&view={$this->name}&provider={$this->name}";

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

    /** @var \GuzzleHttp\Psr7\Response Response object */

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

    /**

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

     * Set message.

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

        $this->set('message', $message);

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

        return $this;

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

            ['name' => 'smil', 'contents' => $this->getSmil()],

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

            $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [

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

            \App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');

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

            $msg['body'] = '<text src="data:text/plain;base64,' . base64_encode($this->get('message')) . '" region="Text"/>';

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

        $this->setPhone($recordModel->get('phone'));

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

        $this->set('idx', $recordModel->getId());

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

        return $result;

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

        foreach (['api_key', 'from'] as $fieldName) {

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

                    $field['label'] = 'FL_API_KEY';

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

    }

Line exceeds 120 characters; contains 129 characters
Open

        return "index.php?module={$model->getName()}&parent={$model->getParentName()}&view={$this->name}&provider={$this->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

        try {

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

                    'Authorization' => 'Bearer ' . $this->getAuthorization(),

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

     * Get smil text for MMS.

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

    public function getFieldInstanceByName(string $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

            ]);

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

            \App\Log::error($e->__toString());

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

                $file = \App\Fields\File::loadFromPath($attach['path']);

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

        $result = $this->send() ?: $this->send(true);

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

                    $field['uitype'] = 99;

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

                    $field['label'] = 'FL_SMSAPI_FROM';

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 $this->isSuccess();

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

     * @param \App\Fields\File $file

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 "<smil>

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

        if ($image && !\App\Json::isEmpty($image)) {

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

    }

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

                    $field['maximumlength'] = '100';

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

                    $field['maximumlength'] = '11';

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

     * Send MMS.

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 bool

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

                'headers' => [

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

    public function addAttachment(\App\Fields\File $file)

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

     *

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

            $image['region'] = '<region id="Image" height="100%" width="100%" fit="meet"/>';

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

        $image = $recordModel->get('image');

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

            }

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

            $fields[$fieldName] = $this->getFieldInstanceByName($fieldName);

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

     * Fields to edit in settings.

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

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

     * @param string $type    Action name for werservice

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

     * @return string

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

            'x-token' => $service['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

    public function getSmil(): string

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

                $file->name = $attach['name'];

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

    public function getEditFields(): array

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

        return $fields;

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

     * @return \Vtiger_Field_Model

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

        $field = ['uitype' => 16, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

                    $field['fromOutsideList'] = 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

    public function getCallBackUrlByService(array $service, string $type): string

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 false;

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

        if (!$this->isEmpty('message')) {

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

        switch ($name) {

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

                    $field = [];

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

        $server = \Settings_WebserviceApps_Record_Model::getInstanceById($serviceId);

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

        $apiKey = \App\Encryption::getInstance()->decrypt($server->get('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

     *

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

                    $field['typeofdata'] = 'V~M';

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

        $callBackUrl = \App\Config::main('site_URL') . 'webservice.php?';

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

        $serviceId = (int) $service['server_id'];

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

     * Add attachemnt.

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

    {

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

            $image['body'] = '<img src="' . \App\Fields\File::getImageBaseData($file->getPath()) . '" region="Image"/>';

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

                case 'from':

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

                    $field['purifyType'] = \App\Purifier::TEXT;

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

        return $callBackUrl . http_build_query($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

     * @param array  $service

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

     *

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

            'module' => 'SMSAPI',

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

            'x-api-key' => $apiKey,

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

            'action' => $type,

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

            '_container' => 'SMS',

Line indented incorrectly; expected 12 spaces, found 16
Open

                default:

Line indented incorrectly; expected 12 spaces, found 16
Open

                case 'api_key':

Line indented incorrectly; expected 8 spaces, found 12
Open

            }

Closing brace indented incorrectly; expected 8 spaces, found 12
Open

            }

Line indented incorrectly; expected 12 spaces, found 16
Open

                case 'from':

There are no issues that match your filters.

Category
Status