denpamusic/php-levin

View on GitHub
src/Types/Type.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

    public function __construct($value = null, int $endianness = self::BE)
    {
        $this->endianness = $endianness;
        $this->value = $value;

Severity: Minor
Found in src/Types/Type.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 short method names like Type::or(). The configured minimum method name length is 3.
Invalid

    public function or($value): self
    {
        $type = clone $this;
        $type->value |= $value instanceof self ? $value->toInt() : $value;

Severity: Minor
Found in src/Types/Type.php by phpmd

ShortMethodName

Since: 0.2

Detects when very short method names are used.

Example

class ShortMethod {
    public function a( $index ) { // Violation
    }
}

Source https://phpmd.org/rules/naming.html#shortmethodname

There are no issues that match your filters.

Category
Status