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';
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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']);
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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"/>';
- Read upRead up
- Exclude checks
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()) ?? [];
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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?';
- Read upRead up
- Exclude checks
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)) {
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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' => ''];
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "POST|" 4 times. Open
\App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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],
- Read upRead up
- Exclude checks
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, [
- Read upRead up
- Exclude checks
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
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "api_key" 3 times. Open
foreach (['api_key', 'from'] as $fieldName) {
- Read upRead up
- Exclude checks
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];
- Read upRead up
- Exclude checks
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');
- Exclude checks
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'));
- Exclude checks
Call to method error
from undeclared class \App\Log
Open
\App\Log::error($e->__toString());
- Exclude checks
Call to method beginProfile
from undeclared class \App\Log
Open
\App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Call to method beginProfile
from undeclared class \App\Log
Open
\App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Argument 2 (callback)
is Closure():''
but \preg_replace_callback()
takes callable(array):string
Open
$phoneNumber = preg_replace_callback('/[^\d]/s', function () {
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Returning type null
but getFieldInstanceByName()
is declared to return \Vtiger_Field_Model
Open
return $field ? \Vtiger_Field_Model::init($moduleName, $field, $name) : null;
- Exclude checks
Parameter $response
has undeclared type \GuzzleHttp\Psr7\Response
Open
public function setResponse($response): self
- Exclude checks
Call to method error
from undeclared class \App\Log
Open
\App\Log::error($e->__toString());
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Call to method request
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Property \App\Integrations\SMSProvider\SMSAPI->response
has undeclared type \GuzzleHttp\Psr7\Response
Open
private $response;
- Exclude checks
Call to method request
from undeclared class \GuzzleHttp\Client
Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Call to method getBody
from undeclared class \GuzzleHttp\Psr7\Response
Open
$this->responseData = \App\Json::decode($this->response->getBody()) ?? [];
- Exclude checks
Call to method getStatusCode
from undeclared class \GuzzleHttp\Psr7\Response
Open
return $this->response && 200 === $this->response->getStatusCode() && empty($this->responseData['error']);
- Exclude checks
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
- Exclude checks
Call to method decodeEmoji
from undeclared class \App\Utils\Completions
Open
$message = \App\Utils\Completions::decodeEmoji($message);
- Exclude checks
Call to method endProfile
from undeclared class \App\Log
Open
\App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Address URL for MMS */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $name = 'SMSAPI';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $format = 'json';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $attach = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getRequiredParams(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setResponse($response): self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->response = $response;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $phoneNumber
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'headers' => $this->getHeaders(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->isSuccess();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Backup address URL */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $mmsUrl = 'https://api.smsapi.pl/mms.do';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->response && 200 === $this->response->getStatusCode() && empty($this->responseData['error']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$phoneNumber = preg_replace_callback('/[^\d]/s', function () {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $params;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::error($e->__toString());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \GuzzleHttp\Psr7\Response $response
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isSuccess(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uri = $this->getUrl($useBackup);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get service URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->set('to', $phoneNumber);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'format' => $this->format
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getRequiredParams() as $key) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('' !== $this->get($key)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['name' => 'subject', 'contents' => $this->getSubject()]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $url = 'https://api.smsapi.pl/sms.do';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $urlBackup = 'https://api2.smsapi.pl/sms.do';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Response body */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setPhone(string $phoneNumber): self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->sendMMS($useBackup);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->sendSMS($useBackup);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $useBackup
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $mmsUrlBackup = 'https://api2.smsapi.pl/mms.do';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $useBackup ? $this->urlBackup : $this->url;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->responseData = \App\Json::decode($this->response->getBody()) ?? [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function getMMSBody(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->attach || mb_strlen($this->get('message')) >= 670) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Format */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Attachments */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['to', 'idx', 'from', 'message'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Backup address URL for MMS */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $responseData;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Required fields.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $e) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}, $phoneNumber);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (['to', 'idx'] as $key) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $params;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function sendSMS(bool $useBackup = false): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'json' => $this->getBody()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getUrl(bool $useBackup = false): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get body data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get body data for MMS.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Send SMS.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $message
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function getBody(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function send(bool $useBackup = false): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->setResponse($response);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->setResponse($response);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function sendByRecord(\Vtiger_Record_Model $recordModel): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\App\Json::decode($image) as $attach) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['purifyType'] = \App\Purifier::ALNUM;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $field ? \Vtiger_Field_Model::init($moduleName, $field, $name) : null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $useBackup
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set response.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if the message was sent successfully.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setMessage(string $message): self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params[$key] = $this->get($key);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['name' => 'format', 'contents' => $this->format],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uri = $useBackup ? $this->mmsUrlBackup : $this->mmsUrl;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::beginProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('msgid', $this->responseData['list'][0]['id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['fieldvalue'] = $this->has($name) ? $this->get($name) : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$model = \Settings_Vtiger_Module_Model::getInstance('Settings:SMSNotifier');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$image = $msg = ['region' => '', 'body' => ''];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$msg['region'] = '<region id="Text" height="100%" width="100%" fit="scroll"/>';
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$msg['body'] = '<text src="data:text/plain;base64,' . base64_encode($this->get('message')) . '" region="Text"/>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['fieldvalue'] = $this->has($name) ? $this->get($name) : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get Edit view url.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Encoding */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $response;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set phone number.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'encoding' => $this->encoding,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params[] = ['name' => $key, 'contents' => $this->get($key) ?? ''];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function sendMMS(bool $useBackup = false): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get subject for MMS.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Callback service URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $encoding = 'utf-8';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Utils\Completions::decodeEmoji($message);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
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');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['uitype'] = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multipart' => $this->getMMSBody()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $e) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSubject(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->setMessage($recordModel->get('message'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result && !empty($this->responseData['list'][0]['id'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = 'Settings:SMSNotifier';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string Url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getEditViewUrl(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $useBackup
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->attach[] = $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->attach as $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->addAttachment($file);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
$field = ['uitype' => 16, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
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}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \GuzzleHttp\Psr7\Response Response object */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set message.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->set('message', $message);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['name' => 'smil', 'contents' => $this->getSmil()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('POST', $uri, [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::endProfile('POST|' . __METHOD__ . "|{$uri}", 'SMSNotifier');
- Exclude checks
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"/>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->setPhone($recordModel->get('phone'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->set('idx', $recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $result;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (['api_key', 'from'] as $fieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['label'] = 'FL_API_KEY';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
return "index.php?module={$model->getName()}&parent={$model->getParentName()}&view={$this->name}&provider={$this->name}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Authorization' => 'Bearer ' . $this->getAuthorization(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get smil text for MMS.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldInstanceByName(string $name)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::error($e->__toString());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = \App\Fields\File::loadFromPath($attach['path']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = $this->send() ?: $this->send(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['uitype'] = 99;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['label'] = 'FL_SMSAPI_FROM';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->isSuccess();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Fields\File $file
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return "<smil>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($image && !\App\Json::isEmpty($image)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['maximumlength'] = '100';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['maximumlength'] = '11';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Send MMS.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'headers' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addAttachment(\App\Fields\File $file)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$image['region'] = '<region id="Image" height="100%" width="100%" fit="meet"/>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$image = $recordModel->get('image');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields[$fieldName] = $this->getFieldInstanceByName($fieldName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Fields to edit in settings.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'api_key':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $type Action name for werservice
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'x-token' => $service['token'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSmil(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file->name = $attach['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getEditFields(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fields;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Vtiger_Field_Model
- Exclude checks
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];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['fromOutsideList'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCallBackUrlByService(array $service, string $type): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->isEmpty('message')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$server = \Settings_WebserviceApps_Record_Model::getInstanceById($serviceId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$apiKey = \App\Encryption::getInstance()->decrypt($server->get('api_key'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['typeofdata'] = 'V~M';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$callBackUrl = \App\Config::main('site_URL') . 'webservice.php?';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$serviceId = (int) $service['server_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add attachemnt.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$image['body'] = '<img src="' . \App\Fields\File::getImageBaseData($file->getPath()) . '" region="Image"/>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'from':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field['purifyType'] = \App\Purifier::TEXT;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $callBackUrl . http_build_query($params);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $service
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module' => 'SMSAPI',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'x-api-key' => $apiKey,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'action' => $type,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'_container' => 'SMS',
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
default:
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
case 'api_key':
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Closing brace indented incorrectly; expected 8 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
case 'from':
- Exclude checks