YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/WebserviceStandard/Users/Record.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
51%

Method get has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $rawData = $this->recordModel->getData();
        $displayData = $fieldsLabel = [];
        foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
Severity: Minor
Found in api/webservice/WebserviceStandard/Users/Record.php - About 1 hr to fix

    Function checkPermission has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function checkPermission(): void
        {
            parent::checkPermission();
            $moduleName = $this->controller->request->getModule();
            if ('POST' === $this->controller->method) {
    Severity: Minor
    Found in api/webservice/WebserviceStandard/Users/Record.php - About 55 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

    Function post has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function post(): array
        {
            if (1 !== $this->getUserData('type')) {
                foreach ($this->recordModel->getModule()->getFieldsByType('serverAccess') as $fieldName => $fieldModel) {
                    if ($fieldModel->getFieldParams() == $this->getUserData('server_id')) {
    Severity: Minor
    Found in api/webservice/WebserviceStandard/Users/Record.php - About 45 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

    Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get(): array
        {
            $rawData = $this->recordModel->getData();
            $displayData = $fieldsLabel = [];
            foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
    Severity: Minor
    Found in api/webservice/WebserviceStandard/Users/Record.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

    Missing class import via use statement (line '36', column '15').
    Open

                    throw new \Api\Core\Exception('No permissions to create user', 403);

    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 '40', column '15').
    Open

                    throw new \Api\Core\Exception('User doesn\'t exist', 404);

    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 '227', column '20').
    Open

            $saveModel = new \Api\WebserviceStandard\Save();

    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 '43', column '15').
    Open

                    throw new \Api\Core\Exception('Access denied, access for administrators only', 403);

    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 '\Users_Record_Model' in method 'checkPermission'.
    Open

                $this->recordModel = \Users_Record_Model::getCleanInstance($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 '\Api\WebserviceStandard\Fields' in method 'post'.
    Open

            \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

    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\User' in method 'checkPermission'.
    Open

                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {

    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

                $fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), 'Users');

    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 '\Users_Record_Model' in method 'checkPermission'.
    Open

                $this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');

    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\Purifier' in method 'get'.
    Open

                'name' => \App\Purifier::decodeHtml($this->recordModel->getName()),

    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

    The method checkPermission uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
                    throw new \Api\Core\Exception('User doesn\'t exist', 404);
                }
                if (!\App\User::getCurrentUserModel()->isAdmin()) {

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

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

                    $rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);

    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 "record" 3 times.
    Open

                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {

    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 "accesskey" 3 times.
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    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 "user_password" 3 times.
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    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 "confirm_password" 3 times.
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    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;

    Call to method isExists from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {

    Argument 2 (value) is 1 but \Users_Record_Model::set() takes string defined at /code/modules/Users/models/Record.php:52
    Open

                        $this->recordModel->set($fieldName, 1);

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                if (!\App\User::getCurrentUserModel()->isAdmin()) {

    Call to undeclared method \Vtiger_Base_UIType::getReferenceModule
    Open

                    $referenceModule = $uiTypeModel->getReferenceModule($value);

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

     * @author    Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>

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

        /** {@inheritdoc}  */

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

            if ('POST' === $this->controller->method) {

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

            parent::checkPermission();

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

        /** {@inheritdoc}  */

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

        {

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

        public $recordModel;

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

        /** @var \Users_Record_Model User record model. */

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

        protected function checkPermission(): void

    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

         * @api

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

         *            name="userId",

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

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

    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

         *        title="Users module - Response body for user",

    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(

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

         *

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

         *            in="path",

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

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

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

         *            description="Access denied, access for administrators only",

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

         *            property="result",

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

         *                description="User data",

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

         *                description="Parameters determining checking of editing rights and moving to the trash",

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

                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {

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

                    throw new \Api\Core\Exception('User doesn\'t exist', 404);

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

         *        operationId="getUser",

    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

         *        schema="Users_Get_Record_Response",

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

         *            @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},

    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

         *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

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

                if (!$this->recordModel->isCreateable()) {

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

                    throw new \Api\Core\Exception('No permissions to create user', 403);

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

            } else {

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

                if (!\App\User::getCurrentUserModel()->isAdmin()) {

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

        /**

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

         * @return array

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

         *        summary="Data for the user",

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

         *            required=true

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

         *            response=200,

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

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

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

         *            response=404,

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

         *            @OA\Property(property="id", description="User Id", type="integer", example=1),

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

         *            @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},

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

         *                @OA\Property(property="isEditable", description="Check if user is editable", type="boolean", example=true),

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

         *            @OA\Property(property="rawData", description="Raw user data", type="object"),

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

                    throw new \Api\Core\Exception('Access denied, access for administrators only', 403);

    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\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),

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

    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(

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

         *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

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

         *            ),

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

     * @license    YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

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

         *

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

         *        description="Gets details about the user",

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

         *            example=116,

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

         *        @OA\Response(

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

         *            description="Gets data for the user",

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

         *            @OA\Property(property="id", description="User Id", type="integer", example=1),

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

        public $allowedMethod = ['GET', 'POST'];

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

         * @OA\Get(

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

         *        @OA\Parameter(

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

         *            @OA\Schema(type="integer"),

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

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

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

         *        ),

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

    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", description="User label", type="string", example="System Admin"),

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

         *                 @OA\AdditionalProperties(type="string", description="Field label"),

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

         *                property="data",

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

                $this->recordModel = \Users_Record_Model::getCleanInstance($moduleName);

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

         *        operationId="getUser",

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

         *            description="Gets data for the user",

    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

                }

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

         *        description="Gets details about the user",

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

         * Get user detail.

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

         *            response=200,

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

         *        tags={"Users"},

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

         *            response=403,

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

         *            description="Access denied, access for administrators only",

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

         *            name="userId",

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

         *            description="User data",

    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="User id",

    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="Parameters determining checking of editing rights and moving to the trash",

    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\Schema(type="integer"),

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

         *        @OA\Response(

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

         *            description="User doesn't exist",

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

         *        schema="Users_Get_Record_Response",

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

         *        title="Users module - Response body for user",

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

         *                 @OA\AdditionalProperties(type="string", description="Field label"),

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

         *                property="data",

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

         *                property="privileges",

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

         *        summary="Data for the user",

    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

         *            required=true

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

         *        @OA\Response(

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

         *        ),

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

         *            response=404,

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

         *            ),

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

         *        tags={"Users"},

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

         *        @OA\Parameter(

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

    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

         *            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

         *            in="path",

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

         *            example=116,

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

         *        @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),

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

         *            property="result",

    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

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

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

         *            description="User doesn't exist",

    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

         *            @OA\Property(property="name", description="User label", type="string", example="System Admin"),

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

                }

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

         *        path="/webservice/WebserviceStandard/Users/Record/{userId}",

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

         *            description="User id",

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

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

         *            description="User data",

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

         *                description="User data",

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

         *                property="privileges",

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

         *            @OA\Property(property="rawData", description="Raw user data", type="object"),

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

                $this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');

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

        }

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

         *        path="/webservice/WebserviceStandard/Users/Record/{userId}",

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

         *            response=403,

    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

         *        ),

    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="isEditable", description="Check if user is editable", type="boolean", example=true),

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

            }

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

    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="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),

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

         *        description="User data in user format for create view",

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

         *    @OA\Link(

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

                if ($fieldModel->isReferenceField()) {

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

            $response = [

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

         *

    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\Link(link="GetUserById", ref="#/components/links/GetUserById")

    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="id", type="integer", description="Id of the newly created user", example=22),

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

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

            foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {

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

                    $rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);

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

         *        summary="Create user",

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

         *        tags={"Users"},

    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

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

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

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

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

         *        title="User - Created user",

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

         *        description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",

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

            $rawData = $this->recordModel->getData();

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

                $value = $this->recordModel->get($fieldModel->getName());

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

            return $response;

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

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

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

         *        ),

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

         *        title="User - Created user",

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

         *        description="Contents of the response contains only id and name",

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

         *            @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),

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

         *        example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},

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

                'data' => $displayData,

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

                $response['rawData'] = $rawData;

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

         *        description="Create new user",

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

         *        @OA\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

         *        ),

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

                $uiTypeModel = $fieldModel->getUITypeModel();

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

                }

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

                'name' => \App\Purifier::decodeHtml($this->recordModel->getName()),

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

         * @api

    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="result", type="object", title="User data", description="Created user id and name.",

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

         *        ),

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

                $displayData[$fieldModel->getName()] = $uiTypeModel->getApiDisplayValue($value, $this->recordModel);

    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

                'fields' => $fieldsLabel,

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

                    'isEditable' => false,

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

         * @OA\Post(

    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="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

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

         *        title="General - User create details",

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

                if ('taxes' === $fieldModel->getFieldDataType()) {

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

                'id' => $this->recordModel->getId(),

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

         *

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

         *        description="Create new user",

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

         *        @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",

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

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

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

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

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

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

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

         *            response=406, description="No input data",

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

         *        schema="User_Post_Record_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

         *        @OA\Property(property="result", type="object", title="User data", description="Created user id and name.",

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

         *            required={"id", "name"},

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

         *        ),

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

                    'moveToTrash' => false,

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

         *        path="/webservice/WebserviceStandard/Users/Record",

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

         *        summary="Create user",

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

    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

                $fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), 'Users');

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

        /**

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

         *        path="/webservice/WebserviceStandard/Users/Record",

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

         *        @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",

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

         *            response=406, description="No input data",

    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="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(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),

    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

                'privileges' => [

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

         *            @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),

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

         *    @OA\Schema(

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

         *        description="User data in user format for create view",

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

         *        link="GetUserById",

    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

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

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

        }

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

         *        @OA\Response(

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

         *        schema="User_Create_Details",

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

         *        type="object",

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

         *        example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},

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

         *        description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",

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

            if ($saveModel->skippedData) {

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

            $displayData = $fieldsLabel = [];

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

            ];

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

         * Create record.

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

         *

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

         *            response=200, description="Contents of the response contains only id",

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

         *        schema="User_Post_Record_Response",

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

         *        schema="User_Create_Details",

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

         *        title="General - User create details",

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

         */

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

                        $this->recordModel->set($fieldName, 1);

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

                'id' => $this->recordModel->getId(),

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

            ];

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

                $return['skippedData'] = $saveModel->skippedData;

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

         */

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

                    $rawData[$fieldModel->getName() . '_module'] = $referenceModule ? $referenceModule->getName() : null;

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

         *        type="object",

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

         *        parameters={

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

         *        }

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

                    if ($fieldModel->getFieldParams() == $this->getUserData('server_id')) {

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

                }

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

            $saveModel->init($this);

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

        {

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

                    $referenceModule = $uiTypeModel->getReferenceModule($value);

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

         *            @OA\Link(link="GetUserById", ref="#/components/links/GetUserById")

    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={"id", "name"},

    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

                foreach ($this->recordModel->getModule()->getFieldsByType('serverAccess') as $fieldName => $fieldModel) {

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

                        break;

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

            return $return;

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

                    }

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

            if (1 === (int) $this->controller->headers['x-raw-data'] ?? 0) {

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

         * @return array

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

         *        tags={"Users"},

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

         *            response=200, description="Contents of the response contains only id",

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

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

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

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

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

         *        description="Contents of the response contains only id and name",

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

         *            @OA\Property(property="id", type="integer", description="Id of the newly created user", example=22),

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

         *    ),

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

         *        link="GetUserById",

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

         *            "recordId" = "$response.body#/result/id"

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

         *        parameters={

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

        public function post(): array

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

            $saveModel = new \Api\WebserviceStandard\Save();

    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

            if (1 !== $this->getUserData('type')) {

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

            \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

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

            $return = [

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

         *            "recordId" = "$response.body#/result/id"

    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

         *        operationId="getUser",

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

         *        }

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

            $saveModel->saveRecord($this->controller->request);

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

                'name' => $this->recordModel->getName(),

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

         *        operationId="getUser",

    Line exceeds 120 characters; contains 129 characters
    Open

                $this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');

    Line exceeds 120 characters; contains 127 characters
    Open

         *                @OA\Property(property="isEditable", description="Check if user is editable", type="boolean", example=true),

    Line exceeds 120 characters; contains 151 characters
    Open

                if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {

    Line exceeds 120 characters; contains 131 characters
    Open

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

    Line exceeds 120 characters; contains 185 characters
    Open

         *            @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},

    Line exceeds 120 characters; contains 155 characters
    Open

         *        @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),

    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 124 characters
    Open

         *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

    Line exceeds 120 characters; contains 127 characters
    Open

                    $rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);

    Line exceeds 120 characters; contains 163 characters
    Open

         *            @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),

    Line exceeds 120 characters; contains 131 characters
    Open

         *        @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",

    Line exceeds 120 characters; contains 270 characters
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    Line exceeds 120 characters; contains 131 characters
    Open

         *            @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),

    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 225 characters
    Open

         *        example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},

    Line exceeds 120 characters; contains 131 characters
    Open

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

    Line exceeds 120 characters; contains 148 characters
    Open

         *        description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    No space found after comma in function call
    Open

            unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);

    There are no issues that match your filters.

    Category
    Status