src/Schema.php
private function resolveAllOfTree(ValidationField $field) {
        $result = [];

        foreach($field->getAllOf() as $allof) {
            if (!is_array($allof) || empty($allof)) {
                throw new ParseException("Invalid allof member in {$field->getSchemaPath()}, array expected", 500);
            }

            list ($items, $schemaPath) = $this->lookupSchema($allof, $field->getSchemaPath());

            $allOfValidation = new ValidationField(
                $field->getValidation(),
                $items,
                '',
                $schemaPath,
                $field->getOptions()
            );

            if($allOfValidation->hasAllOf()) {
                $result = array_replace_recursive($result, $this->resolveAllOfTree($allOfValidation));
            } else {
                $result = array_replace_recursive($result, $items);
            }
        }

        return $result;
    }
private function resolveAllOfTree(ValidationField $field) {
        $result = [];

        foreach($field->getAllOf() as $allof) {
            if (!is_array($allof) || empty($allof)) {
                throw new ParseException("Invalid allof member in {$field->getSchemaPath()}, array expected", 500);
            }

            list ($items, $schemaPath) = $this->lookupSchema($allof, $field->getSchemaPath());

            $allOfValidation = new ValidationField(
                $field->getValidation(),
                $items,
                '',
                $schemaPath,
                $field->getOptions()
            );

            if($allOfValidation->hasAllOf()) {
                $result = array_replace_recursive($result, $this->resolveAllOfTree($allOfValidation));
            } else {
                $result = array_replace_recursive($result, $items);
            }
        }

        return $result;
    }
private function resolveAllOfTree ( ValidationField $ field ) { $ result = [ ] ; foreach ( $ field -> getAllOf ( ) as $ allof ) { if ( ! is_array ( $ allof ) || empty ( $ allof ) ) { throw new ParseException ( "Invalid allof member in {$field->getSchemaPath()}, array expected" , 500 ) ; } list ( $ items , $ schemaPath ) = $ this -> lookupSchema ( $ allof , $ field -> getSchemaPath ( ) ) ; $ allOfValidation = new ValidationField ( $ field -> getValidation ( ) , $ items , '' , $ schemaPath , $ field -> getOptions ( ) ) ; if ( $ allOfValidation -> hasAllOf ( ) ) { $ result = array_replace_recursive ( $ result , $ this -> resolveAllOfTree ( $ allOfValidation ) ) ; } else { $ result = array_replace_recursive ( $ result , $ items ) ; } } return $ result ; }
Recursively resolve allOf inheritance tree and return a merged resource specification

@param ValidationField $field The validation results to add.
@return array Returns an array of merged specs.
@throws ParseException Throws an exception if an invalid allof member is provided
@throws RefNotFoundException Throws an exception if the array has an items `$ref` that cannot be found.
Recursively resolve allOf inheritance tree and return a merged resource specification