YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/LayoutExport.php

Summary

Maintainability
A
35 mins
Test Coverage
F
0%

Method register has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)
Severity: Minor
Found in vtlib/Vtiger/LayoutExport.php - About 35 mins to fix

    Missing class import via use statement (line '81', column '27').
    Open

            $layoutresultrow = (new \App\Db\Query())->from(self::TABLENAME)->where(['name' => $layoutName])->one();
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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

    The method export has a boolean flag argument $directDownload, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function export($layoutName, $todir = '', $zipfilename = '', $directDownload = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    The method register has a boolean flag argument $isactive, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    The method register has a boolean flag argument $isdefault, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    The method register has a boolean flag argument $overrideCore, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    Missing class import via use statement (line '128', column '17').
    Open

            $resId = (new \App\Db\Query())->select(['id'])->from(self::TABLENAME)->where(['name' => $name])->scalar();
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 'vtlib\Utils' in method '__initExport'.
    Open

            Utils::checkFileAccessForInclusion("layouts/$layoutName/skins/style.less");
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 register uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $params['id'] = \App\Db::getInstance()->getUniqueID(self::TABLENAME, 'id', false);
                $db->insert(self::TABLENAME, $params)->execute();
            }
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 '\App\Log' in method 'deregister'.
    Open

            \App\Log::trace("Deregistering Layout $name ... DONE", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 'exportLayout'.
    Open

            $layoutname = \App\Purifier::decodeHtml($layoutresultrow['name']);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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\Version' in method 'exportLayoutDependencies'.
    Open

            $this->outputNode(\App\Version::get(), 'vtiger_version');
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 'vtlib\Functions' in method 'deregister'.
    Open

            Functions::recurseDelete('layouts' . \DIRECTORY_SEPARATOR . $name);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 export uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $zip->close();
                if ($todir) {
                    copy($zipfilename, $todir);
                }
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 '\App\Zip' in method 'export'.
    Open

            $zip = \App\Zip::createFile($zipfilename);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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 'exportLayout'.
    Open

            $layoutlabel = \App\Purifier::decodeHtml($layoutresultrow['label']);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    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\Log' in method 'register'.
    Open

            \App\Log::trace("Registering Layout $name ... DONE", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

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

            $layoutlabel = \App\Purifier::decodeHtml($layoutresultrow['label']);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by sonar-php

    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.

    Declaration of function export($layoutName, $todir = '', $zipfilename = '', $directDownload = null) should be compatible with function export(\vtlib\Module $moduleInstance, $todir = '', $zipFileName = '', $directDownload = null) (parameter #1 with no type cannot replace original parameter with type '\vtlib\Module') defined in /code/vtlib/Vtiger/PackageExport.php:140
    Open

         * @param string $layoutName
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            $resId = (new \App\Db\Query())->select(['id'])->from(self::TABLENAME)->where(['name' => $name])->scalar();
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Declaration of function export(string $layoutName, string $todir = '', string $zipfilename = '', bool|false $directDownload = null) should be compatible with function export(\vtlib\Module $moduleInstance, string $todir = '', string $zipFileName = '', bool|false $directDownload = null) defined in /code/vtlib/Vtiger/PackageExport.php:140
    Open

        public function export($layoutName, $todir = '', $zipfilename = '', $directDownload = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace("Deregistering Layout $name ... DONE", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            $db = \App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Variable $prefix is undeclared
    Open

            $prefix = trim($prefix);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            \App\Db::getInstance()->createCommand()->delete(self::TABLENAME, ['name' => $name])->execute();
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to undeclared method \App\Db\Query::from
    Open

            $layoutresultrow = (new \App\Db\Query())->from(self::TABLENAME)->where(['name' => $layoutName])->one();
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace("Registering Layout $name ... DONE", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutExport.php by phan

    Avoid variables with short names like $db. Configured minimum length is 3.
    Open

            $db = \App\Db::getInstance()->createCommand();
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

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

         * @param bool   $directDownload

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

            $zip = \App\Zip::createFile($zipfilename);

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

         * Export Layout Handler.

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

         * @param string $zipfilename

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

         */

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

            // Export as Zip

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

            if ('' === $zipfilename) {

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

         * Initialize Export.

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

                $zipfilename = "$layoutName-" . date('YmdHis') . '.zip';

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

            }

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

         *

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

            // Security check to ensure file is withing the web folder.

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

         *

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

            $this->outputNode(date('Y-m-d H:i:s'), 'exporttime');

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

                'label' => $label,

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

            }

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

                if ($todir) {

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

         * @param bool   $isdefault

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

            ];

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

                $db->update(self::TABLENAME, $params, ['id' => $resId])->execute();

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

                return;

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

        public function __initExport($layoutName)

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

            $this->__initExport($layoutName);

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

            $zip->addDirectory('layouts/' . $layoutName);

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

                    copy($zipfilename, $todir);

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

                }

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

        {

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

            $this->openNode('dependencies');

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

            } else {

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

        const TABLENAME = 'vtiger_layout';

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

            // Copy module directory

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

         *

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

            $this->closeNode('module');

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

            $this->outputNode(\App\Version::get(), 'vtiger_version');

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

        }

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

            $resId = (new \App\Db\Query())->select(['id'])->from(self::TABLENAME)->where(['name' => $name])->scalar();

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

                'isdefault' => ($isdefault) ? 1 : 0,

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

            }

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

            \App\Log::trace("Deregistering Layout $name ... DONE", __METHOD__);

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

        /**

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

         * @param string $layoutName

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

            $this->exportLayout($layoutName);

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

        /**

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

        /**

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

        /**

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

         *

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

            \App\Db::getInstance()->createCommand()->delete(self::TABLENAME, ['name' => $name])->execute();

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

         */

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

        {

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

            $this->__write("<?xml version='1.0'?>\n");

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

        /**

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

         * Export Module as a zip file.

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

            // Call layout export function

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

            // Add manifest file

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

            if ($directDownload) {

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

        public function exportLayoutDependencies()

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

         * @param bool   $isactive

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

            // We will not allow registering core layouts unless forced

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

            $this->_export_modulexml_file = fopen($this->__getManifestFilePath(), 'w');

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

            $zip->addFile($this->__getManifestFilePath(), 'manifest.xml');

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

            } else {

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

            $layoutresultrow = (new \App\Db\Query())->from(self::TABLENAME)->where(['name' => $layoutName])->one();

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

         */

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

                $this->outputNode($maxVersion, 'vtiger_max_version');

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

                'name' => $name,

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

                'active' => ($isactive) ? 1 : 0,

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

                $params['id'] = \App\Db::getInstance()->getUniqueID(self::TABLENAME, 'id', false);

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

            \App\Log::trace("Registering Layout $name ... DONE", __METHOD__);

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

        }

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

            Utils::checkFileAccessForInclusion("layouts/$layoutName/skins/style.less");

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

         * @param string $todir

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

            $zipfilename = "$this->_export_tmpdir/$zipfilename";

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

                $zip->download($layoutName);

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

         */

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

            $this->openNode('module');

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

            $this->outputNode($layoutname, 'name');

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

            if ('basic' == strtolower($name) && false === $overrideCore) {

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

                return;

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

            }

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

            $db = \App\Db::getInstance()->createCommand();

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

                $db->insert(self::TABLENAME, $params)->execute();

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

        public function export($layoutName, $todir = '', $zipfilename = '', $directDownload = false)

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

            $this->__finishExport();

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

        }

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

         * @param string $layoutName

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

            $layoutlabel = \App\Purifier::decodeHtml($layoutresultrow['label']);

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

            $this->outputNode('layout', 'type');

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

            }

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

        }

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

        {

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

            $this->outputNode($layoutlabel, 'label');

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

        public static function register($name, $label = '', $isdefault = false, $isactive = true, $overrideCore = false)

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

        public static function deregister($name)

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

        {

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

         * @param string $layoutName

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

                $zip->close();

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

            $this->__cleanupExport();

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

            $layoutname = \App\Purifier::decodeHtml($layoutresultrow['name']);

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

        }

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

         * @param string $name

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

            }

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

         */

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

            $prefix = trim($prefix);

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

         * @param string $label

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

            if ('basic' == strtolower($name)) {

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

            Functions::recurseDelete('layouts' . \DIRECTORY_SEPARATOR . $name);

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

            if (false !== $maxVersion) {

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

         * Register layout pack information.

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

            $this->exportLayoutDependencies();

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

            $params = [

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

            $maxVersion = false;

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

        {

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

                'lastupdated' => date('Y-m-d H:i:s'),

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

        public function exportLayout($layoutName)

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

        {

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

            // Export dependency information

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

         * Export vtiger dependencies.

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

            $this->closeNode('dependencies');

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

         * @param bool   $overrideCore

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

            if ($resId) {

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

        }

    The method __initExport is not named in camelCase.
    Open

        public function __initExport($layoutName)
        {
            // Security check to ensure file is withing the web folder.
            Utils::checkFileAccessForInclusion("layouts/$layoutName/skins/style.less");
    
    
    Severity: Minor
    Found in vtlib/Vtiger/LayoutExport.php by phpmd

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status