Missing class import via use statement (line '67', column '14'). Open
throw new \Api\Core\Exception('No permissions for module', 403);
- 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
Missing class import via use statement (line '59', column '14'). Open
throw new \Api\Core\Exception('No permission - wrong data', 401);
- 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 '\Vtiger_Record_Model' in method 'get'. Open
&& ($recordModel = \Vtiger_Record_Model::getInstanceById($recordId, $this->moduleName))->isEditable()
- 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 assigning values to variables in if clauses and the like (line '66', column '131'). Open
protected function checkPermissionToModule(): void
{
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
throw new \Api\Core\Exception('No permissions for module', 403);
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Privilege' in method 'checkPermissionToModule'. Open
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
- 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\Integrations\SMSProvider' in method 'checkPermissionToModule'. Open
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
- 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 assigning values to variables in if clauses and the like (line '120', column '9'). Open
public function get()
{
$recordIds = $this->controller->request->getExploded('idx', ',', \App\Purifier::INTEGER);
$msgIds = $this->controller->request->getExploded('MsgId', ',', \App\Purifier::ALNUM);
$statuses = $this->controller->request->getExploded('status', ',', \App\Purifier::INTEGER);
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Record' in method 'get'. Open
if (\App\Record::isExists($recordId, $this->moduleName)
- 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 '\Api\Core\Module' in method 'checkPermissionToModule'. Open
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
- 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
Remove this unused "STATUSES" private field. Open
private const STATUSES = [
- Read upRead up
- Exclude checks
If a private
field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will
improve maintainability because developers will not wonder what the variable is used for.
Noncompliant Code Example
class MyClass { private $foo = 4; //foo is unused public function compute($a) { return $a * 4; } }
Compliant Solution
class MyClass { public function compute($a) { return $a * 4; } }
See
- CERT, MSC12-CPP. - Detect and remove code that has no effect
Define a constant instead of duplicating this literal "PLL_FAILED" 4 times. Open
402 => 'PLL_FAILED',
- 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.
Possibly zero references to use statement for classlike/namespace OA
(\OpenApi\Annotations)
Open
use OpenApi\Annotations as OA;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
parent::checkPermission();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/SMS/SMSAPI/Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=401,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Method Not Allowed",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 405 => 'UNDELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 411 => 'RENEWAL',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
410 => 'PLL_DELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* externalDocs={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$recordIds = $this->controller->request->getExploded('idx', ',', \App\Purifier::INTEGER);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$statuses = $this->controller->request->getExploded('status', ',', \App\Purifier::INTEGER);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo 'OK';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Update record status.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Report for sms",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=401,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 407 => 'REJECTED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Post(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('No permission - wrong data', 401);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Report for sms",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "description" : "SMSApi Documentation",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Method Not Allowed",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 406 => 'FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 408 => 'UNKNOWN',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"SMSAPI"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=405,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="SMS_SMSAPI_Get_Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 403 => 'SENT',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 404 => 'DELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* {"ApiKeyAuth" : {}, "token" : {}}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/SMS/SMSAPI/Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 407 => 'REJECTED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 409 => 'QUEUE',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Update record status.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "url" : "https://www.smsapi.pl/docs"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* {"ApiKeyAuth" : {}, "token" : {}}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/SMS_SMSAPI_Get_Report")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "url" : "https://www.smsapi.pl/docs"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Method Not Allowed",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 410 => 'ACCEPTED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=401,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=405,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$msgIds = $this->controller->request->getExploded('MsgId', ',', \App\Purifier::ALNUM);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
&& !$recordModel->isEmpty('msgid') && \in_array($recordModel->get('msgid'), $msgIds)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
&& $recordModel->set('smsnotifier_status', static::STATUSES[$statuses[$key]] ?? 'PLL_UNDEFINED')->getPreviousValue()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->get();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
402 => 'PLL_FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
405 => 'PLL_FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Report for sms",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="`No sent token` OR `Invalid token` OR `wrong data provided in the request`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
foreach ($recordIds as $key => $recordId) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Report for sms",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="string",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 411 => 'RENEWAL',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
408 => 'PLL_SENT',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* externalDocs={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/SMS_SMSAPI_Get_Report")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* externalDocs={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "url" : "https://www.smsapi.pl/docs"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="`No sent token` OR `Invalid token` OR `wrong data provided in the request`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function post()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
407 => 'PLL_FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
protected function checkPermissionToModule(): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/SMS/SMSAPI/Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"SMSAPI"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "description" : "SMSApi Documentation",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* {"ApiKeyAuth" : {}, "token" : {}}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="`No sent token` OR `Invalid token` OR `wrong data provided in the request`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 408 => 'UNKNOWN',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 410 => 'ACCEPTED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "description" : "SMSApi Documentation",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example="OK"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function get()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/SMS/SMSAPI/Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* {"ApiKeyAuth" : {}, "token" : {}}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 409 => 'QUEUE',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
403 => 'PLL_SENT',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (\App\Record::isExists($recordId, $this->moduleName)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/SMS_SMSAPI_Post_Report")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=405,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="SMS_SMSAPI_Post_Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="string",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example="OK"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
private const STATUSES = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!$this->controller->request->getExploded('MsgId', ',', \App\Purifier::ALNUM) || !$this->controller->request->getExploded('status', ',', \App\Purifier::INTEGER) || !$this->controller->request->getExploded('to', ',', \App\Purifier::ALNUM)) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('No permissions for module', 403);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Get(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "url" : "https://www.smsapi.pl/docs"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="`No sent token` OR `Invalid token` OR `wrong data provided in the request`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="string",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example="OK"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 405 => 'UNDELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 406 => 'FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 412 => 'STOP'.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 412 => 'STOP'.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
404 => 'PLL_DELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
406 => 'PLL_FAILED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
protected function checkPermission(): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="string",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"SMSAPI"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"SMSAPI"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "description" : "SMSApi Documentation",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Method Not Allowed",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* 404 => 'DELIVERED',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="SMS_SMSAPI_Get_Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
&& ($recordModel = \Vtiger_Record_Model::getInstanceById($recordId, $this->moduleName))->isEditable()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* },
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/SMS_SMSAPI_Post_Report")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=405,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="SMS_SMSAPI_Post_Report",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* externalDocs={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=401,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example="OK"
- 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
* Get status for record by code.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 402 => 'EXPIRED',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Module name */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Statuses from api:
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
&& $recordModel->set('smsnotifier_status', static::STATUSES[$statuses[$key]] ?? 'PLL_UNDEFINED')->getPreviousValue()
- Exclude checks
Line exceeds 120 characters; contains 240 characters Open
if (!\Api\Core\Module::checkModuleAccess($this->moduleName) || !\App\Privilege::isPermitted($this->moduleName, 'EditView') || !($provider = \App\Integrations\SMSProvider::getDefaultProvider()) || 'SMSAPI' !== $provider->getName()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $allowedMethod = ['GET', 'POST'];
- 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 $moduleName = 'SMSNotifier';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 403 => 'SENT',
- Exclude checks
Line exceeds 120 characters; contains 251 characters Open
if (!$this->controller->request->getExploded('MsgId', ',', \App\Purifier::ALNUM) || !$this->controller->request->getExploded('status', ',', \App\Purifier::INTEGER) || !$this->controller->request->getExploded('to', ',', \App\Purifier::ALNUM)) {
- Exclude checks