jkphl/dom-factory

View on GitHub
src/Domfactory/Infrastructure/Dom.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    protected static function createViaStreamWrapper($url, array $options = [])
    {
        $clientOptions  = isset($options['client']) ? (array)$options['client'] : [];
        $opts           = array_merge_recursive([
            'http' => [
Severity: Minor
Found in src/Domfactory/Infrastructure/Dom.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

Line exceeds 120 characters; contains 165 characters
Open

                'user_agent'       => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.466.4 Safari/534.3',

There are no issues that match your filters.

Category
Status