YetiForceCompany/YetiForceCRM

View on GitHub
app/Debug/DebugBar/DebugBar.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Layout' in method 'loadScripts'.
Open

        return $this->getJavascriptRenderer(\App\Layout::getPublicUrl('vendor/maximebf/debugbar/src/DebugBar/Resources'))->renderHead();
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.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

Reference to undeclared property \App\Debug\DebugBar\DebugBar->jsRenderer
Open

        return $this->jsRenderer;
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.php by phan

Call with 3 arg(s) to \App\Debug\DebugBar\JavascriptRenderer::__construct() which only takes 0 arg(s) defined at /code/app/Debug/DebugBar/JavascriptRenderer.php:17
Open

            $this->jsRenderer = new JavascriptRenderer($this, $baseUrl, $basePath);
Severity: Info
Found in app/Debug/DebugBar/DebugBar.php by phan

Reference to undeclared property \App\Debug\DebugBar\DebugBar->jsRenderer
Open

            $this->jsRenderer = new JavascriptRenderer($this, $baseUrl, $basePath);
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.php by phan

Call to undeclared method \App\Debug\DebugBar\JavascriptRenderer::renderHead
Open

        return $this->getJavascriptRenderer(\App\Layout::getPublicUrl('vendor/maximebf/debugbar/src/DebugBar/Resources'))->renderHead();
Severity: Critical
Found in app/Debug/DebugBar/DebugBar.php by phan

Reference to undeclared property \App\Debug\DebugBar\DebugBar->jsRenderer
Open

        if (null === $this->jsRenderer) {
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.php by phan

Reference to undeclared property \App\Debug\DebugBar\DebugBar->jsRenderer
Open

            $this->jsRenderer->disableVendor('jquery');
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.php by phan

Reference to undeclared property \App\Debug\DebugBar\DebugBar->jsRenderer
Open

            $this->jsRenderer->setOptions([
Severity: Minor
Found in app/Debug/DebugBar/DebugBar.php by phan

Class extends undeclared class \DebugBar\DebugBar (Did you mean class \App\Debug\DebugBar\DebugBar)
Open

class DebugBar extends \DebugBar\DebugBar
Severity: Critical
Found in app/Debug/DebugBar/DebugBar.php by phan

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

            $this->jsRenderer->setOptions([

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

        return $this->jsRenderer;

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

     * Renders the html to include needed assets.

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

        if (null === $this->jsRenderer) {

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

            $this->jsRenderer->disableVendor('jquery');

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

     * @return JavascriptRenderer

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

                'enable_jquery_noconflict' => 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

     * Returns a JavascriptRenderer for this instance.

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

     */

Line exceeds 120 characters; contains 136 characters
Open

        return $this->getJavascriptRenderer(\App\Layout::getPublicUrl('vendor/maximebf/debugbar/src/DebugBar/Resources'))->renderHead();

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

     * @return void

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

     * @param string $baseUrl

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

     * @param string $basePath

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->jsRenderer = new JavascriptRenderer($this, $baseUrl, $basePath);

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 loadScripts()

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

    public function getJavascriptRenderer($baseUrl = null, $basePath = null)

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

        return $this->getJavascriptRenderer(\App\Layout::getPublicUrl('vendor/maximebf/debugbar/src/DebugBar/Resources'))->renderHead();

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

    }

There are no issues that match your filters.

Category
Status