public static function createFromArray($name, array $data = [])
    {
        $proxy = new static($name);
        $proxy->setDefinition($data);
        if (!isset($data['type'])) {
            throw new \InvalidArgumentException('Missing "type" key in $data param to determine datatype!');
        }
        if (isset($data['properties'])) {
            $proxy->properties = $data['properties'];
        }

        $proxy->setType($data['type']);
        if ($name !== $data['type']) {
            $proxy->setParent($data['type']);
        }

        return $proxy;
    }
public static function createFromArray($name, array $data = [])
    {
        $proxy = new static($name);
        $proxy->setDefinition($data);
        if (!isset($data['type'])) {
            throw new \InvalidArgumentException('Missing "type" key in $data param to determine datatype!');
        }
        if (isset($data['properties'])) {
            $proxy->properties = $data['properties'];
        }

        $proxy->setType($data['type']);
        if ($name !== $data['type']) {
            $proxy->setParent($data['type']);
        }

        return $proxy;
    }
public static function createFromArray ( $ name , array $ data = [ ] ) { $ proxy = new static ( $ name ) ; $ proxy -> setDefinition ( $ data ) ; if ( ! isset ( $ data [ 'type' ] ) ) { throw new \ InvalidArgumentException ( 'Missing "type" key in $data param to determine datatype!' ) ; } if ( isset ( $ data [ 'properties' ] ) ) { $ proxy -> properties = $ data [ 'properties' ] ; } $ proxy -> setType ( $ data [ 'type' ] ) ; if ( $ name !== $ data [ 'type' ] ) { $ proxy -> setParent ( $ data [ 'type' ] ) ; } return $ proxy ; }
Create a new LazyProxyType from an array of data

@param string $name Type name.
@param array $data Type data.
@return LazyProxyType

@throws \InvalidArgumentException
Create a new LazyProxyType from an array of data