src/PropertyProcessor/ComposedValue/AbstractComposedValueProcessor.php
Method generateValidators
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function generateValidators(PropertyInterface $property, JsonSchema $propertySchema): void
{
$json = $propertySchema->getJson()['propertySchema']->getJson();
if (empty($json[$propertySchema->getJson()['type']]) &&
Method getCompositionProperties
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getCompositionProperties(PropertyInterface $property, JsonSchema $propertySchema): array
{
$propertyFactory = new PropertyFactory(new PropertyProcessorFactory());
$compositionProperties = [];
$json = $propertySchema->getJson()['propertySchema']->getJson();
The class AbstractComposedValueProcessor has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13. Open
Open
abstract class AbstractComposedValueProcessor extends AbstractValueProcessor
{
private ?PropertyInterface $mergedProperty = null;
/**
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open
Open
private ?PropertyInterface $mergedProperty = null;
- Exclude checks
Multi-line function call not indented correctly; expected 32 spaces but found 34 Open
Open
)
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 20 Open
Open
static fn(CompositionPropertyDecorator $property): string =>
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
private bool $rootLevelComposition,
- Exclude checks
Expected 0 spaces before closing bracket; newline found Open
Open
$compositionProperty->filterValidators(static fn(Validator $validator): bool =>
- Exclude checks
Multi-line function call not indented correctly; expected 20 spaces but found 24 Open
Open
$property->getType() ? $property->getType()->getName() : '',
- Exclude checks