src/WarnDynamicPropertyTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '19', column '29').
Open

            $propRefl = new \ReflectionProperty($class, $name);
Severity: Minor
Found in src/WarnDynamicPropertyTrait.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '21', column '27').
Open

                throw new \Error('Cannot access protected property ' . $class . '::$' . $name);
Severity: Minor
Found in src/WarnDynamicPropertyTrait.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Avoid using empty try-catch blocks in warnPropertyDoesNotExist.
Open

        } catch (\ReflectionException $e) {
        }
Severity: Minor
Found in src/WarnDynamicPropertyTrait.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

There are no issues that match your filters.

Category
Status