YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/WebservicePremium/BaseAction/Menu.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

            'items' => \Settings_Menu_Record_Model::parseToDisplay($menu),

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

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

     *        @OA\Response(

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

     *            response=200,

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

     *        title="Base action - Menu",

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

     *                property="items",

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

     *                    @OA\Property(property="id", type="integer", example=171),

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

     *                     @OA\Property(property="type", type="string", example="Module"),

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

     *                     @OA\Property(property="sequence", type="integer", example=1),

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

     *                     @OA\Property(property="newwindow", type="integer", example=0),

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

     *                     @OA\Property(property="dataurl", type="string", example="index.php?module=Module&view=List&mid=172"),

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

     *        path="/webservice/WebservicePremium/Menu",

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

     *        summary="Gets the menu for the portal",

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

     *        description="Get menu",

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

     *            response=200,

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

     *        type="object",

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

     *        @OA\Property(

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

     *            property="result",

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

     *                     @OA\Property(property="filters", type="string", example="4,130"),

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

     *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

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

     *        schema="BaseAction_Get_Menu_Response",

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

     *            @OA\Property(

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

     *                    description="Tree item",

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

     *                    description="Tree item",

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

     *                     @OA\Property(property="newwindow", type="integer", example=0),

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

     *                     @OA\Property(property="parent", type="integer", example=0),

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

        $menu = \Settings_Menu_Record_Model::getCleanInstance()->getChildMenu($this->controller->app['id'], 0, \Settings_Menu_Record_Model::SRC_API);

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

     *            description="Menu details",

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

     *        ),

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

     *            property="result",

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

     *            description="Menu items selected in the system, consists of parents and children",

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

     *            type="object",

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

     *                property="items",

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

     *        tags={"BaseAction"},

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\Schema(

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

     *        title="Base action - Menu",

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

     *                title="Parent parameters",

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

     *                     @OA\Property(property="mod", type="string", example="Accounts"),

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

     *                     @OA\Property(property="name", type="string", example="Accounts"),

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

     *    @OA\Get(

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

     *        schema="BaseAction_Get_Menu_Response",

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

     *        description="Base action menu response body",

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

     *            description="Menu items selected in the system, consists of parents and children",

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

     *                    type="object",

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

        return [

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

     *        description="Get menu",

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

     *        type="object",

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

     *                     @OA\Property(property="name", type="string", example="Accounts"),

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

     *                     @OA\Property(property="hotkey", type="string", example="ctrl+k"),

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

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

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

     *                     @OA\Property(property="label", type="string", example="My home page"),

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

     *                title="Parent parameters",

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="parent", type="integer", example=0),

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

     *                     @OA\Property(property="hotkey", type="string", example="ctrl+k"),

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

        ];

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

     *        path="/webservice/WebservicePremium/Menu",

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

     *        summary="Gets the menu for the portal",

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

     *        description="Base action menu response body",

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

     *            type="object",

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

     *                type="object",

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

     *                    type="object",

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

     *                     @OA\Property(property="tabid", type="integer", example=3),

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

     *                     @OA\Property(property="icon", type="string", example="dminIcon-shared-owner"),

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

     *                     @OA\Property(property="childs", type="object", title="Children parameters"),

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

     *                 ),

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

            'items' => \Settings_Menu_Record_Model::parseToDisplay($menu),

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\JsonContent(ref="#/components/schemas/BaseAction_Get_Menu_Response"),

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

     *                     @OA\Property(property="icon", type="string", example="dminIcon-shared-owner"),

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

     *            description="Menu details",

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

     *    @OA\Schema(

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

     *            @OA\Property(

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

     *                     @OA\Property(property="mod", type="string", example="Accounts"),

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\XmlContent(ref="#/components/schemas/BaseAction_Get_Menu_Response"),

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

    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

     *        tags={"BaseAction"},

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

     *        @OA\Response(

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

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

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\AdditionalProperties(

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

     *                @OA\AdditionalProperties(

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

     *                    @OA\Property(property="id", type="integer", example=171),

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

     *                     @OA\Property(property="tabid", type="integer", example=3),

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

     *                     @OA\Property(property="type", type="string", example="Module"),

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

     *                     @OA\Property(property="sequence", type="integer", example=1),

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

     *                     @OA\Property(property="childs", type="object", title="Children parameters"),

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

     *                     @OA\Property(property="label", type="string", example="My home page"),

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

     *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

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

     *        @OA\Property(

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

     *                     @OA\Property(property="dataurl", type="string", example="index.php?module=Module&view=List&mid=172"),

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

     *                     @OA\Property(property="filters", type="string", example="4,130"),

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

     * Get method - Gets the menu for the portal.

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

     * @return array

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

    /**

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

     *

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

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

     *    @OA\Get(

Line exceeds 120 characters; contains 149 characters
Open

        $menu = \Settings_Menu_Record_Model::getCleanInstance()->getChildMenu($this->controller->app['id'], 0, \Settings_Menu_Record_Model::SRC_API);

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

    public $allowedMethod = ['GET'];

Line exceeds 120 characters; contains 125 characters
Open

     *                     @OA\Property(property="dataurl", type="string", example="index.php?module=Module&view=List&mid=172"),

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

     *

Line exceeds 120 characters; contains 131 characters
Open

     *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

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

    /** {@inheritdoc}  */

There are no issues that match your filters.

Category
Status