Method get
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(): array
{
$moduleName = $this->controller->request->getModule();
$moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
$return = [];
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$moduleName = $this->controller->request->getModule();
$moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
$return = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid using static access to class '\App\Language' in method 'get'. Open
'label' => \App\Language::translate('LBL_UPDATES', $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 '\App\Language' in method 'get'. Open
'label' => \App\Language::translate($relation->get('label'), $relation->get('relatedModuleName')),
- 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 '104', column '44'). Open
public function get(): array
{
$moduleName = $this->controller->request->getModule();
$moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
$return = [];
- 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 '\Vtiger_Module_Model' in method 'get'. Open
$moduleModel = \Vtiger_Module_Model::getInstance($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 '\Vtiger_Module_Model' in method 'get'. Open
if ($moduleModel->isCommentEnabled() && ($modCommentsModel = \Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {
- 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\Language' in method 'get'. Open
'label' => \App\Language::translate('LBL_RECORD_SUMMARY', $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 '\App\Language' in method 'get'. Open
'label' => \App\Language::translate('LBL_RECORD_DETAILS', $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 '\App\Language' in method 'get'. Open
'label' => \App\Language::translate('ModComments', $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
Define a constant instead of duplicating this literal "label" 6 times. Open
'label' => \App\Language::translate('LBL_RECORD_SUMMARY', $moduleName),
- 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 "relatedModuleName" 4 times. Open
'label' => \App\Language::translate($relation->get('label'), $relation->get('relatedModuleName')),
- 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
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- 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="Module action related modules list response body",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="label", type="string", description="Translated label", example="Documents"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="icon", type="string", description="Icon class", example="yfm-Documents"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="viewType", type="array", @OA\Items(type="string"), description="View types", example={"RelatedTab", "DetailBottom"}),
- 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
* summary="Related list of modules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- 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
* required={"status", "result"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=401, description="`No sent token` OR `Invalid token`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="label", type="string", description="Translated label", example="Documents"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/{moduleName}/RelatedModules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=401, description="`No sent token` OR `Invalid token`",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="base", type="object", title="Base list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="relationId", type="integer", description="Relation ID", example=3),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="customView", type="array", @OA\Items(type="string"), description="Custom view", example={"relation", "all"}),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Related list of modules",
- 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\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- 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\AdditionalProperties(type="object",
- 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
'label' => \App\Language::translate('LBL_UPDATES', $moduleName),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'relatedModuleName' => $relation->get('relatedModuleName'),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=405, 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
* @OA\Property(property="result", type="object", title="List of related records",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="relationId", type="integer", description="Relation ID", example=3),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- 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
* title="Base module - Response action related modules list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Module action related modules list response body",
- 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\Property(property="customView", type="array", @OA\Items(type="string"), description="Custom view", example={"relation", "all"}),
- 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
'type' => 'comments',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('ModTracker')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'actions' => $relation->getActions(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets a list of related modules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=200, description="List of related modules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=200, description="List of related modules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- 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\Property(property="related", type="object", title="Base list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return = [];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return['base'][] = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'type' => 'updates',
- 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(response=403, description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\AdditionalProperties(type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\AdditionalProperties(type="object",
- 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
if ($moduleModel->isSummaryViewSupported()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return['base'][] = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="BaseModule_Get_RelatedModules_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Base module - Response action related modules list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"status", "result"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="result", type="object", title="List of related records",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"type", "label", "icon"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="type", type="string", description="Type", example="Summary"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="label", type="string", description="Translated label", example="Summary"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="related", type="object", title="Base list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function get(): array
- 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\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),
- 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\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"BaseModule"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"BaseModule"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="viewType", type="array", @OA\Items(type="string"), description="View types", example={"RelatedTab", "DetailBottom"}),
- 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
'icon' => 'far fa-list-alt',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"type", "label", "icon"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'label' => \App\Language::translate($relation->get('label'), $relation->get('relatedModuleName')),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'relationId' => $relation->get('relation_id'),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $return;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets a list of related modules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- 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
* schema="BaseModule_Get_RelatedModules_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\AdditionalProperties(type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="actions", type="array", @OA\Items(type="string"), description="Actions", example={"add", "select"}),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="actions", type="array", @OA\Items(type="string"), description="Actions", example={"add", "select"}),
- 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
'icon' => 'fas fa-history',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/{moduleName}/RelatedModules",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=403, description="No permissions for module",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(response=405, description="Method Not Allowed",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),
- 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
'label' => \App\Language::translate('LBL_RECORD_SUMMARY', $moduleName),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return['base'][] = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'icon' => 'yfm-' . $relation->get('relatedModuleName'),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'viewType' => $relation->getRelatedViewType(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"base", "related"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="label", type="string", description="Translated label", example="Summary"),
- 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\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"base", "related"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="base", type="object", title="Base list",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="type", type="string", description="Type", example="Summary"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="icon", type="string", description="Icon class", example="yfm-Documents"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return['base'][] = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'label' => \App\Language::translate('LBL_RECORD_DETAILS', $moduleName),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'label' => \App\Language::translate('ModComments', $moduleName),
- 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
$moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'type' => 'summary',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'type' => 'details',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'icon' => 'far fa-comments',
- 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
$return['related'][$relation->get('relation_id')] = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$moduleName = $this->controller->request->getModule();
- 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
if ($moduleModel->isCommentEnabled() && ($modCommentsModel = \Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {
- 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
'icon' => 'fas fa-desktop',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
foreach ($moduleModel->getRelations() as $relation) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'customView' => $relation->getCustomView(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @api
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
* required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},
- 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
* @return array
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
* @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
* @OA\Property(property="viewType", type="array", @OA\Items(type="string"), description="View types", example={"RelatedTab", "DetailBottom"}),
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
* @OA\Property(property="customView", type="array", @OA\Items(type="string"), description="Custom view", example={"relation", "all"}),
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
* @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $allowedMethod = ['GET'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @OA\Get(
- Exclude checks
Line exceeds 120 characters; contains 169 characters Open
if ($moduleModel->isCommentEnabled() && ($modCommentsModel = \Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
* @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),
- 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 related modules list method.
- Exclude checks
Line exceeds 120 characters; contains 189 characters Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
* @OA\Property(property="label", type="string", description="Translated label", example="Summary"),
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
* @OA\Property(property="label", type="string", description="Translated label", example="Documents"),
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
* @OA\Property(property="actions", type="array", @OA\Items(type="string"), description="Actions", example={"add", "select"}),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks