Avoid using static access to class '\DrdPlus\Codes\Theurgist\AffectionPeriodCode' in method 'I_can_create_it_without_period'. Open
self::assertSame(AffectionPeriodCode::getIt(AffectionPeriodCode::DAILY), $affection->getAffectionPeriodCode());
- 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 '\DrdPlus\Codes\Theurgist\AffectionPeriodCode' in method 'I_can_create_it_with_explicit_period'. Open
self::assertSame(AffectionPeriodCode::getIt(AffectionPeriodCode::MONTHLY), $affection->getAffectionPeriodCode());
- 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 '\DrdPlus\Codes\Theurgist\AffectionPeriodCode' in method 'I_can_create_zero_affection'. Open
self::assertSame(AffectionPeriodCode::getIt(AffectionPeriodCode::DAILY), $affection->getAffectionPeriodCode());
- 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
The method I_can_create_it_without_period is not named in camelCase. Open
public function I_can_create_it_without_period()
{
$affection = new RealmsAffection(['-213']);
self::assertSame(-213, $affection->getValue());
self::assertSame('-213 daily', (string)$affection);
- 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 I_can_create_it_with_explicit_period is not named in camelCase. Open
public function I_can_create_it_with_explicit_period()
{
$affection = new RealmsAffection(['-357', AffectionPeriodCode::MONTHLY]);
self::assertSame(-357, $affection->getValue());
self::assertSame('-357 monthly', (string)$affection);
- 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 I_can_not_create_positive_affection is not named in camelCase. Open
public function I_can_not_create_positive_affection()
{
$this->expectException(\DrdPlus\Tables\Theurgist\Spells\SpellParameters\Exceptions\InvalidFormatForNegativeCastingParameter::class);
$this->expectExceptionMessageMatches('~1~');
new RealmsAffection(['1']);
- 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 I_can_create_zero_affection is not named in camelCase. Open
public function I_can_create_zero_affection()
{
$affection = new RealmsAffection(['0']);
self::assertSame(0, $affection->getValue());
self::assertSame('0', (string)$affection);
- 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() {
}
}