tests/Unit.php

Summary

Maintainability
A
0 mins
Test Coverage

Remove error control operator '@' on line 57.
Open

    protected function path($code)
    {
        $this->lastView = $view = 'flow__' . Str::random();
        $tmp = \sys_get_temp_dir() . '/' . $this->lastView . $this->flow->ext();
        File::put($tmp, $code);
Severity: Minor
Found in tests/Unit.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 58.
Open

    protected function path($code)
    {
        $this->lastView = $view = 'flow__' . Str::random();
        $tmp = \sys_get_temp_dir() . '/' . $this->lastView . $this->flow->ext();
        File::put($tmp, $code);
Severity: Minor
Found in tests/Unit.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 59.
Open

    protected function path($code)
    {
        $this->lastView = $view = 'flow__' . Str::random();
        $tmp = \sys_get_temp_dir() . '/' . $this->lastView . $this->flow->ext();
        File::put($tmp, $code);
Severity: Minor
Found in tests/Unit.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Avoid using static access to class '\Bavix\Helpers\File' in method 'path'.
Open

            @File::remove(\sys_get_temp_dir() . '/' . $this->folder . '/' . $view . '.php');
Severity: Minor
Found in tests/Unit.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 '\Bavix\Helpers\Str' in method 'path'.
Open

        $this->lastView = $view = 'flow__' . Str::random();
Severity: Minor
Found in tests/Unit.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 '\Bavix\Helpers\Dir' in method 'path'.
Open

            @Dir::remove(\sys_get_temp_dir() . '/' . $this->folder);
Severity: Minor
Found in tests/Unit.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 '\Bavix\Helpers\File' in method 'path'.
Open

        File::put($tmp, $code);
Severity: Minor
Found in tests/Unit.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 '\Bavix\Helpers\File' in method 'path'.
Open

            @File::remove($tmp);
Severity: Minor
Found in tests/Unit.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 closing brace for the class must go on the next line after the body
Open

}
Severity: Minor
Found in tests/Unit.php by phpcodesniffer

There are no issues that match your filters.

Category
Status