src/BaseValidator.php
protected static function createFromObjectForAdditional($object)
    {
        $indexProperty = null;
        $class = null;

        if (property_exists($object, 'anyOf')) {
            $indexProperty = 'anyOf';
            $class = AnyOf::class;
        } elseif (property_exists($object, 'allOf')) {
            $indexProperty = 'allOf';
            $class = AllOf::class;
        } elseif (property_exists($object, 'oneOf')) {
            $indexProperty = 'oneOf';
            $class = OneOf::class;
        } else {
            return null;
        }

        //Parse index property's object as validator
        foreach ($object->{$indexProperty} as &$property) {
            $property = BaseValidator::createFromObject($property);
        }

        $validator = new $class($object->{$indexProperty});

        return $validator;
    }
protected static function createFromObjectForAdditional($object)
    {
        $indexProperty = null;
        $class = null;

        if (property_exists($object, 'anyOf')) {
            $indexProperty = 'anyOf';
            $class = AnyOf::class;
        } elseif (property_exists($object, 'allOf')) {
            $indexProperty = 'allOf';
            $class = AllOf::class;
        } elseif (property_exists($object, 'oneOf')) {
            $indexProperty = 'oneOf';
            $class = OneOf::class;
        } else {
            return null;
        }

        //Parse index property's object as validator
        foreach ($object->{$indexProperty} as &$property) {
            $property = BaseValidator::createFromObject($property);
        }

        $validator = new $class($object->{$indexProperty});

        return $validator;
    }
protected static function createFromObjectForAdditional ( $ object ) { $ indexProperty = null ; $ class = null ; if ( property_exists ( $ object , 'anyOf' ) ) { $ indexProperty = 'anyOf' ; $ class = AnyOf :: class ; } elseif ( property_exists ( $ object , 'allOf' ) ) { $ indexProperty = 'allOf' ; $ class = AllOf :: class ; } elseif ( property_exists ( $ object , 'oneOf' ) ) { $ indexProperty = 'oneOf' ; $ class = OneOf :: class ; } else { return null ; } //Parse index property's object as validator foreach ( $ object -> { $ indexProperty } as & $ property ) { $ property = BaseValidator :: createFromObject ( $ property ) ; } $ validator = new $ class ( $ object -> { $ indexProperty } ) ; return $ validator ; }
Helper method.
Used to create anyOf, allOf and oneOf validators from objects
@param  object $object Validation object
@return AnyOf|AllOf|OneOf|null
Helper method . Used to create anyOf allOf and oneOf validators from objects