YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Debuger' in method 'execute'.
Open

        $this->boundParameters['backtrace'] = \App\Debuger::getBacktrace(4);

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 class \DebugBar\DataCollector\PDO\TraceablePDOStatement (Did you mean class \App\Debug\DebugBar\TraceablePDOStatement)
Open

        return parent::execute($input_parameters);

Reference to undeclared property \App\Debug\DebugBar\TraceablePDOStatement->boundParameters
Open

        $this->boundParameters['backtrace'] = \App\Debuger::getBacktrace(4);

Reference to undeclared property \App\Debug\DebugBar\TraceablePDOStatement->pdo
Open

        $this->boundParameters['driverName'] = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);

Reference to undeclared property \App\Debug\DebugBar\TraceablePDOStatement->boundParameters
Open

        $this->boundParameters['driverName'] = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);

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

class TraceablePDOStatement extends \DebugBar\DataCollector\PDO\TraceablePDOStatement

The parameter $input_parameters is not named in camelCase.
Open

    public function execute($input_parameters = null)
    {
        $this->boundParameters['backtrace'] = \App\Debuger::getBacktrace(4);
        $this->boundParameters['driverName'] = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
        return parent::execute($input_parameters);

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

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

        return parent::execute($input_parameters);

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

    {

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

     *                                are bound parameters in the SQL statement being executed. All values are treated as

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->boundParameters['driverName'] = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);

Line exceeds 120 characters; contains 121 characters
Open

     *                                are bound parameters in the SQL statement being executed. All values are treated as

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

    public function execute($input_parameters = null)

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 bool TRUE on success or FALSE on failure.

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

     * Executes a prepared statement.

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

     * @param array $input_parameters [optional] An array of values with as many elements as there

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

     * @throws PDOException

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->boundParameters['backtrace'] = \App\Debuger::getBacktrace(4);

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

     * @see   http://php.net/manual/en/pdostatement.execute.php

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

     *                                PDO::PARAM_STR.

The variable $input_parameters is not named in camelCase.
Open

    public function execute($input_parameters = null)
    {
        $this->boundParameters['backtrace'] = \App\Debuger::getBacktrace(4);
        $this->boundParameters['driverName'] = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME);
        return parent::execute($input_parameters);

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status