Sindbad~EG File Manager

Current Path : /home/escuelai/public_html/it/vendor/swaggest/json-schema/src/Structure/
Upload File :
Current File : /home/escuelai/public_html/it/vendor/swaggest/json-schema/src/Structure/Composition.php

<?php

namespace Swaggest\JsonSchema\Structure;

use Swaggest\JsonSchema\Constraint\Properties;
use Swaggest\JsonSchema\Constraint\Type;
use Swaggest\JsonSchema\Schema;
use Swaggest\JsonSchema\SchemaContract;
use Swaggest\JsonSchema\Wrapper;

/**
 * @todo think of anyOf, allOf, oneOf
 */
class Composition extends Schema
{
    /**
     * @param SchemaContract... $schema
     * @throws \Swaggest\JsonSchema\Exception
     */
    public function __construct()
    {
        $this->type = Type::OBJECT;
        $properties = new Properties();
        $this->properties = $properties;

        foreach (func_get_args() as $arg) {
            if ($arg instanceof Wrapper) {
                $properties->__set($arg->objectItemClass, $arg->nested());
            }
        }
    }

}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists