YetiForceCompany/YetiForceCRM

View on GitHub
modules/API/handlers/CalDAV.php

Summary

Maintainability
A
0 mins
Test Coverage
B
80%

Avoid using static access to class '\App\Integrations\Dav\Calendar' in method 'entityAfterDelete'.
Open

        \App\Integrations\Dav\Calendar::deleteByCrmId($eventHandler->getRecordModel()->getId());
Severity: Minor
Found in modules/API/handlers/CalDAV.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

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

        \App\Db::getInstance()->createCommand()
Severity: Critical
Found in modules/API/handlers/CalDAV.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class API_CalDAV_Handler

The class API_CalDAV_Handler is not named in CamelCase.
Open

class API_CalDAV_Handler
{
    /**
     * EntityAfterSave handler function.
     *
Severity: Minor
Found in modules/API/handlers/CalDAV.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

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

    public function entityAfterDelete(App\EventHandler $eventHandler)

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

    public function entityAfterSave(App\EventHandler $eventHandler)

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

            $this->entityChangeState($eventHandler);

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

            ->update('vtiger_activity', ['dav_status' => 1], ['activityid' => $eventHandler->getRecordModel()->getId()])

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 (!$recordModel->isNew()) {

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 \App\EventHandler $eventHandler

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

     * EntityAfterSave handler function.

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

     * EntityChangeState handler function.

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

        \App\Db::getInstance()->createCommand()

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

    /**

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

        $recordModel = $eventHandler->getRecordModel();

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

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

     * EntityAfterDelete handler function.

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

     * @param \App\EventHandler $eventHandler

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

     */

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

    public function entityChangeState(App\EventHandler $eventHandler)

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\Integrations\Dav\Calendar::deleteByCrmId($eventHandler->getRecordModel()->getId());

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

     * @param App\EventHandler $eventHandler

Class name "API_CalDAV_Handler" is not in camel caps format
Open

class API_CalDAV_Handler

There are no issues that match your filters.

Category
Status