src/Flow/FileSystem.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        if (empty($this->paths[$view]) && ($this->flow->debugMode() || !File::exists($path)))
Severity: Minor
Found in src/Flow/FileSystem.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 'has'.
Open

            Dir::make($directory);
Severity: Minor
Found in src/Flow/FileSystem.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

Rename "$path" which has the same name as the field declared at line 24.
Open

        $path      = $this->get($view);
Severity: Major
Found in src/Flow/FileSystem.php by sonar-php

Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

Noncompliant Code Example

class Foo {
  public $myField;

  public function doSomething() {
    $myField = 0;
    ...
  }
}

See

The closing brace for the class must go on the next line after the body
Open

}
Severity: Minor
Found in src/Flow/FileSystem.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 9
Open

        if (empty($this->paths[$view]) && ($this->flow->debugMode() || !File::exists($path)))
Severity: Minor
Found in src/Flow/FileSystem.php by phpcodesniffer

There are no issues that match your filters.

Category
Status