YetiForceCompany/YetiForceCRM

View on GitHub
app/Debug/DebugBarLogs.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\DebugBar\DataCollector\DataCollector' in method 'getDataFormatter'.
Open

            $this->dataFormater = DataCollector::getDefaultDataFormatter();
Severity: Minor
Found in app/Debug/DebugBarLogs.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

Class implements undeclared interface \DebugBar\DataCollector\MessagesAggregateInterface
Open

class DebugBarLogs implements DataCollectorInterface, MessagesAggregateInterface, Renderable
Severity: Critical
Found in app/Debug/DebugBarLogs.php by phan

Parameter $messagesAggregate has undeclared type \DebugBar\DataCollector\MessagesAggregateInterface
Open

    public function aggregate(MessagesAggregateInterface $messagesAggregate)
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phan

Call to method formatVar from undeclared class \DebugBar\DataFormatter\DataFormatterInterface
Open

            $traces = $this->getDataFormatter()->formatVar($traces);
Severity: Critical
Found in app/Debug/DebugBarLogs.php by phan

Class implements undeclared interface \DebugBar\DataCollector\Renderable
Open

class DebugBarLogs implements DataCollectorInterface, MessagesAggregateInterface, Renderable
Severity: Critical
Found in app/Debug/DebugBarLogs.php by phan

Class implements undeclared interface \DebugBar\DataCollector\DataCollectorInterface
Open

class DebugBarLogs implements DataCollectorInterface, MessagesAggregateInterface, Renderable
Severity: Critical
Found in app/Debug/DebugBarLogs.php by phan

Parameter $formater has undeclared type \DebugBar\DataFormatter\DataFormatterInterface
Open

    public function setDataFormatter(DataFormatterInterface $formater)
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phan

Call to method getDefaultDataFormatter from undeclared class \DebugBar\DataCollector\DataCollector
Open

            $this->dataFormater = DataCollector::getDefaultDataFormatter();
Severity: Critical
Found in app/Debug/DebugBarLogs.php by phan

Return type of getDataFormatter() is undeclared type \DebugBar\DataFormatter\DataFormatterInterface
Open

    public function getDataFormatter()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phan

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $this->dataFormater = $formater;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return $this;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            $this->dataFormater = DataCollector::getDefaultDataFormatter();
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function setDataFormatter(DataFormatterInterface $formater)
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return $this->dataFormater;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param string $name
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    protected $messages = [];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param DataFormatterInterface $formater
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    protected $aggregates = [];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    protected $dataFormater;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        if (null === $this->dataFormater) {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return $this
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return DataFormatterInterface
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function getDataFormatter()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    protected $name;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function __construct($name = 'logs')
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * Sets the data formater instance used by this collector.
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $this->name = $name;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param mixed  $message
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param mixed  $traces
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * Deletes all messages.
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $this->messages = [];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        if (!\is_string($traces)) {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'map' => "$widgetName.messages",
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'default' => 'null',
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        ];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function aggregate(MessagesAggregateInterface $messagesAggregate)
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            'messages' => $messagesCollect,
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $this->aggregates[] = $messagesAggregate;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            'label' => $label,
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            'count' => \count($messagesCollect),
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            "$widgetName" => [
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            ],
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            ],
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        ];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * A message can be anything from an object to a string
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $this->messages[] = [
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * Aggregates messages from other collectors.
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return $this->messages;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return [
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param string $label
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return $this->name;
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function getName()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $widgetName = $this->getName();
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        return [
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'default' => '[]',
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @param MessagesAggregateInterface $messagesAggregate
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function getMessages()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        $messagesCollect = $this->getMessages();
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            'trace' => $traces,
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'icon' => 'list-alt',
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            "$widgetName:badge" => [
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function addMessage($message, $label = 'info', $traces = [])
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            'message' => $message,
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

        ];
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function getWidgets()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

     * Adds a message.
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'map' => "$widgetName.count",
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

            $traces = $this->getDataFormatter()->formatVar($traces);
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function clear()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    public function collect()
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

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

                'widget' => 'PhpDebugBar.Widgets.DebugLogsWidget',
Severity: Minor
Found in app/Debug/DebugBarLogs.php by phpcodesniffer

There are no issues that match your filters.

Category
Status