YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/WebserviceStandard/BaseModule/RelatedModules.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

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 = [];
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RelatedModules.php - About 1 hr to fix

    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 = [];
    Severity: Minor
    Found in api/webservice/WebserviceStandard/BaseModule/RelatedModules.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid using static access to class '\App\Language' in method 'get'.
    Open

                    'label' => \App\Language::translate('LBL_UPDATES', $moduleName),

    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')),

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

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

    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')) {

    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),

    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),

    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),

    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),

    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')),

    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;

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        description="Module action related modules list response body",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                    required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Documents"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="icon", type="string", description="Icon class", example="yfm-Documents"),

    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"}),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    @OA\Get(

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        summary="Related list of modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    @OA\Schema(

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        required={"status", "result"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=401, description="`No sent token` OR `Invalid token`",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Documents"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        path="/webservice/WebserviceStandard/{moduleName}/RelatedModules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=401, description="`No sent token` OR `Invalid token`",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\Property(property="base", type="object", title="Base list",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="relationId", type="integer", description="Relation ID", example=3),

    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"}),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        summary="Related list of modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                @OA\AdditionalProperties(type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                 ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            ),

    Spaces must be used for alignment; tabs are not allowed
    Open

                ];

    Spaces must be used for alignment; tabs are not allowed
    Open

                ];

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label' => \App\Language::translate('LBL_UPDATES', $moduleName),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'relatedModuleName' => $relation->get('relatedModuleName'),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

    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"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=405, description="Method Not Allowed",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Property(property="result", type="object", title="List of related records",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="relationId", type="integer", description="Relation ID", example=3),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        title="Base module - Response action related modules list",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        description="Module action related modules list response body",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            ),

    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"}),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            ),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'comments',

    Spaces must be used for alignment; tabs are not allowed
    Open

            if ($moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('ModTracker')) {

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'actions' => $relation->getActions(),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        description="Gets a list of related modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=200, description="List of related modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=200, description="List of related modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                 ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                 ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\Property(property="related", type="object", title="Base list",

    Spaces must be used for alignment; tabs are not allowed
    Open

            $return = [];

    Spaces must be used for alignment; tabs are not allowed
    Open

                $return['base'][] = [

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'updates',

    Spaces must be used for alignment; tabs are not allowed
    Open

                ];

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=403, description="No permissions for module",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                @OA\AdditionalProperties(type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                @OA\AdditionalProperties(type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ),

    Spaces must be used for alignment; tabs are not allowed
    Open

            if ($moduleModel->isSummaryViewSupported()) {

    Spaces must be used for alignment; tabs are not allowed
    Open

                $return['base'][] = [

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        schema="BaseModule_Get_RelatedModules_Response",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        title="Base module - Response action related modules list",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        required={"status", "result"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Property(property="result", type="object", title="List of related records",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                    required={"type", "label", "icon"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="type", type="string", description="Type", example="Summary"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Summary"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\Property(property="related", type="object", title="Base list",

    Spaces must be used for alignment; tabs are not allowed
    Open

        public function get(): array

    Spaces must be used for alignment; tabs are not allowed
    Open

            }

    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"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    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"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        tags={"BaseModule"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        tags={"BaseModule"},

    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"}),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

            }

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ),

    Spaces must be used for alignment; tabs are not allowed
    Open

                'icon' => 'far fa-list-alt',

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                    required={"type", "label", "icon"},

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label' => \App\Language::translate($relation->get('label'), $relation->get('relatedModuleName')),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'relationId' => $relation->get('relation_id'),

    Spaces must be used for alignment; tabs are not allowed
    Open

            return $return;

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        description="Gets a list of related modules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    @OA\Schema(

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        schema="BaseModule_Get_RelatedModules_Response",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                @OA\AdditionalProperties(type="object",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                    required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},

    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"}),

    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"}),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                 ),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'icon' => 'fas fa-history',

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        path="/webservice/WebserviceStandard/{moduleName}/RelatedModules",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_RelatedModules_Response"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=403, description="No permissions for module",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        @OA\Response(response=405, description="Method Not Allowed",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         */

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label' => \App\Language::translate('LBL_RECORD_SUMMARY', $moduleName),

    Spaces must be used for alignment; tabs are not allowed
    Open

                $return['base'][] = [

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'icon' => 'yfm-' . $relation->get('relatedModuleName'),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'viewType' => $relation->getRelatedViewType(),

    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"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            required={"base", "related"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Summary"),

    Spaces must be used for alignment; tabs are not allowed
    Open

                ];

    Spaces must be used for alignment; tabs are not allowed
    Open

         *        ),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\XmlContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\JsonContent(ref="#/components/schemas/Exception"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            required={"base", "related"},

    Spaces must be used for alignment; tabs are not allowed
    Open

         *            @OA\Property(property="base", type="object", title="Base list",

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="type", type="string", description="Type", example="Summary"),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *                     @OA\Property(property="icon", type="string", description="Icon class", example="yfm-Documents"),

    Spaces must be used for alignment; tabs are not allowed
    Open

            $return['base'][] = [

    Spaces must be used for alignment; tabs are not allowed
    Open

                'label' => \App\Language::translate('LBL_RECORD_DETAILS', $moduleName),

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'label' => \App\Language::translate('ModComments', $moduleName),

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ),

    Spaces must be used for alignment; tabs are not allowed
    Open

            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'type' => 'summary',

    Spaces must be used for alignment; tabs are not allowed
    Open

                'type' => 'details',

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'icon' => 'far fa-comments',

    Spaces must be used for alignment; tabs are not allowed
    Open

            }

    Spaces must be used for alignment; tabs are not allowed
    Open

         *         ),

    Spaces must be used for alignment; tabs are not allowed
    Open

            ];

    Spaces must be used for alignment; tabs are not allowed
    Open

                $return['related'][$relation->get('relation_id')] = [

    Spaces must be used for alignment; tabs are not allowed
    Open

            $moduleName = $this->controller->request->getModule();

    Spaces must be used for alignment; tabs are not allowed
    Open

        {

    Spaces must be used for alignment; tabs are not allowed
    Open

            if ($moduleModel->isCommentEnabled() && ($modCommentsModel = \Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {

    Spaces must be used for alignment; tabs are not allowed
    Open

         *         ),

    Spaces must be used for alignment; tabs are not allowed
    Open

            }

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'icon' => 'fas fa-desktop',

    Spaces must be used for alignment; tabs are not allowed
    Open

            foreach ($moduleModel->getRelations() as $relation) {

    Spaces must be used for alignment; tabs are not allowed
    Open

                    'customView' => $relation->getCustomView(),

    Spaces must be used for alignment; tabs are not allowed
    Open

        }

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

         * @api

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

         *

    Line exceeds 120 characters; contains 123 characters
    Open

         *                    required={"label", "relationId", "relatedModuleName", "icon", "actions", "viewType", "customView"},

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

        /** {@inheritdoc}  */

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

         * @return array

    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"),

    Line exceeds 120 characters; contains 164 characters
    Open

         *                     @OA\Property(property="viewType", type="array", @OA\Items(type="string"), description="View types", example={"RelatedTab", "DetailBottom"}),

    Line exceeds 120 characters; contains 156 characters
    Open

         *                     @OA\Property(property="customView", type="array", @OA\Items(type="string"), description="Custom view", example={"relation", "all"}),

    Line exceeds 120 characters; contains 138 characters
    Open

         *                     @OA\Property(property="relatedModuleName", type="string", description="Related module name", example="Documents"),

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

        public $allowedMethod = ['GET'];

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

         *    @OA\Get(

    Line exceeds 120 characters; contains 169 characters
    Open

            if ($moduleModel->isCommentEnabled() && ($modCommentsModel = \Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {

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

         *

    Line exceeds 120 characters; contains 121 characters
    Open

         *                     @OA\Property(property="icon", type="string", description="Icon class", example="fas fa-desktop"),

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

        /**

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

         * Get related modules list method.

    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"),

    Line exceeds 120 characters; contains 121 characters
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Summary"),

    Line exceeds 120 characters; contains 123 characters
    Open

         *                     @OA\Property(property="label", type="string", description="Translated label", example="Documents"),

    Line exceeds 120 characters; contains 147 characters
    Open

         *                     @OA\Property(property="actions", type="array", @OA\Items(type="string"), description="Actions", example={"add", "select"}),

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

         *

    There are no issues that match your filters.

    Category
    Status