src/PropertyProcessor/Property/ConstProcessor.php
Avoid using static access to class '\PHPModelGenerator\Utils\RenderHelper' in method 'process'. Open
Open
=> '!in_array($value, ' . RenderHelper::varExportArray([$json['const'], null]) . ', true)',
- 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 '\PHPModelGenerator\Utils\TypeConverter' in method 'process'. Open
Open
new PropertyType(TypeConverter::gettypeToInternal(gettype($json['const']))),
- 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
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 26 and the first side effect is on line 21. Open
Open
<?php
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class ConstProcessor extends AbstractPropertyProcessor
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class ConstProcessor extends AbstractPropertyProcessor
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
=> "array_key_exists('{$property->getName()}', \$modelData) && \$value !== " . var_export($json['const'], true),
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 0 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
Open
public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 12 Open
Open
default
- Exclude checks