protected function subfieldConflicts(
        array $conflicts,
        string $responseName,
        FieldNode $nodeA,
        FieldNode $nodeB
    ): ?Conflict {
        if (empty($conflicts)) {
            return null;
        }

        return new Conflict(
            $responseName,
            array_map(function (Conflict $conflict) {
                return [$conflict->getResponseName(), $conflict->getReason()];
            }, $conflicts),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsA());
            }, [$nodeA]),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsB());
            }, [$nodeB])
        );
    }
protected function subfieldConflicts(
        array $conflicts,
        string $responseName,
        FieldNode $nodeA,
        FieldNode $nodeB
    ): ?Conflict {
        if (empty($conflicts)) {
            return null;
        }

        return new Conflict(
            $responseName,
            array_map(function (Conflict $conflict) {
                return [$conflict->getResponseName(), $conflict->getReason()];
            }, $conflicts),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsA());
            }, [$nodeA]),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsB());
            }, [$nodeB])
        );
    }
protected function subfieldConflicts ( array $ conflicts , string $ responseName , FieldNode $ nodeA , FieldNode $ nodeB ) : ? Conflict { if ( empty ( $ conflicts ) ) { return null ; } return new Conflict ( $ responseName , array_map ( function ( Conflict $ conflict ) { return [ $ conflict -> getResponseName ( ) , $ conflict -> getReason ( ) ] ; } , $ conflicts ) , array_reduce ( $ conflicts , function ( $ allFields , Conflict $ conflict ) { return array_merge ( $ allFields , $ conflict -> getFieldsA ( ) ) ; } , [ $ nodeA ] ) , array_reduce ( $ conflicts , function ( $ allFields , Conflict $ conflict ) { return array_merge ( $ allFields , $ conflict -> getFieldsB ( ) ) ; } , [ $ nodeB ] ) ) ; }
Given a series of Conflicts which occurred between two sub-fields, generate
a single Conflict.

@param array|Conflict[] $conflicts
@param string           $responseName
@param FieldNode        $nodeA
@param FieldNode        $nodeB
@return Conflict|null
Given a series of Conflicts which occurred between two sub - fields generate a single Conflict .