Avoid using static access to class '\Mockery' in method 'setUp'. Open
$this->request = Mockery::mock(Request::class);
- 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 '\Mockery' in method 'tearDown'. Open
Mockery::close();
- 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
Method name "EndpointsContainerTest::it_returns_a_provider_instance" is not in camel caps format Open
public function it_returns_a_provider_instance()
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
}
- Exclude checks
Method name "EndpointsContainerTest::it_delegates_setters_to_request_object" is not in camel caps format Open
public function it_delegates_setters_to_request_object()
- Exclude checks
Method name "EndpointsContainerTest::it_throws_exception_when_accessing_request_setter_that_doesnt_exist" is not in camel caps format Open
public function it_throws_exception_when_accessing_request_setter_that_doesnt_exist()
- Exclude checks
Method name "EndpointsContainerTest::it_throws_exception_when_trying_to_access_wrong_provider" is not in camel caps format Open
public function it_throws_exception_when_trying_to_access_wrong_provider()
- Exclude checks
Opening brace should be on a new line Open
public function tearDown() {
- Exclude checks
The method it_throws_exception_when_trying_to_access_wrong_provider is not named in camelCase. Open
public function it_throws_exception_when_trying_to_access_wrong_provider()
{
$this->expectException(WrongEndPointException::class);
$this->container->getEndpoint('unknown');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method it_throws_exception_when_accessing_request_setter_that_doesnt_exist is not named in camelCase. Open
public function it_throws_exception_when_accessing_request_setter_that_doesnt_exist()
{
$this->expectException(HeadHunterApiException::class);
$this->container->setProperty('value');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method it_delegates_setters_to_request_object is not named in camelCase. Open
public function it_delegates_setters_to_request_object()
{
$host = 'value';
$this->request->shouldReceive('setHost')
->once()
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method it_returns_a_provider_instance is not named in camelCase. Open
public function it_returns_a_provider_instance()
{
$provider = $this->container->vacancies;
$this->assertInstanceOf(Vacancies::class, $provider);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}