Method resolve
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolve(int $timeout): ?EasyRdf\Resource
{
try {
// unregister the legacy "json" format as it causes problems with CONSTRUCT requests
EasyRdf\Format::unregister('json');
Missing class import via use statement (line '44', column '27'). Open
$client = new EasyRdf\Sparql\Client(self::WDQS_ENDPOINT);
- Read upRead up
- Exclude checks
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 static access to class 'EasyRdf\Http' in method 'resolve'. Open
$httpclient = EasyRdf\Http::getDefaultHttpClient();
- Read upRead up
- Exclude checks
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 'EasyRdf\Format' in method 'resolve'. Open
EasyRdf\Format::unregister('json');
- Read upRead up
- Exclude checks
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 'EasyRdf\Http' in method 'resolve'. Open
EasyRdf\Http::setDefaultHttpClient($httpclient);
- Read upRead up
- Exclude checks
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();
}
}