Method testCreateFromArray
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCreateFromArray()
{
$messageParser = new MessageParser();
// Test with bad keys
Method testCreateFromJSON
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCreateFromJSON()
{
$messageParser = new MessageParser();
// Test with an invalid JSON string
The method testCreateFromArray() has 125 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function testCreateFromArray()
{
$messageParser = new MessageParser();
// Test with bad keys
- Exclude checks
Avoid using static access to class '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromArray'. Open
WebSocketRequest::createFromArray(
[
'message' => [
'a' => 'b'
],
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromArray'. Open
WebSocketRequest::createFromArray(
[
'tags' => [
'tag1' => 'tag1Value',
'tag2' => 'tag2Value'
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromArray'. Open
$webSocketRequest = WebSocketRequest::createFromArray(
[
'message' => [
'type' => 'MY_TYPE',
'metadata' => [
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromJSON'. Open
WebSocketRequest::createFromJSON(654, $messageParser);
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromJSON'. Open
$webSocketRequest = WebSocketRequest::createFromJSON(
'{
"message" : {
"type" : "MY_TYPE",
"metadata" : {
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromArray'. Open
WebSocketRequest::createFromArray(
[
'message' => [
'type' => 'MY_TYPE',
'metadata' => [
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testCreateFromArray'. Open
WebSocketRequest::createFromArray(['badKey' => 'value'], $messageParser);
- 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();
}
}