protected function ensureRequiredAttributes(array $spec = [])
    {
        if (! isset($spec['attributes'])) {
            throw new MissingAttributeException(
                sprintf('The attribute "attributes" is not defined, but required.')
            );
        }

        $required = ['type', 'name'];
        foreach ($required as $key) {
            if (! isset($spec['attributes'][$key])) {
                throw new MissingAttributeException(
                    sprintf('The attribute "%s" is not defined, but required.', $key)
                );
            }
        }
    }
protected function ensureRequiredAttributes(array $spec = [])
    {
        if (! isset($spec['attributes'])) {
            throw new MissingAttributeException(
                sprintf('The attribute "attributes" is not defined, but required.')
            );
        }

        $required = ['type', 'name'];
        foreach ($required as $key) {
            if (! isset($spec['attributes'][$key])) {
                throw new MissingAttributeException(
                    sprintf('The attribute "%s" is not defined, but required.', $key)
                );
            }
        }
    }
protected function ensureRequiredAttributes ( array $ spec = [ ] ) { if ( ! isset ( $ spec [ 'attributes' ] ) ) { throw new MissingAttributeException ( sprintf ( 'The attribute "attributes" is not defined, but required.' ) ) ; } $ required = [ 'type' , 'name' ] ; foreach ( $ required as $ key ) { if ( ! isset ( $ spec [ 'attributes' ] [ $ key ] ) ) { throw new MissingAttributeException ( sprintf ( 'The attribute "%s" is not defined, but required.' , $ key ) ) ; } } }
Internal function to ensure, that all required attributes are available.

@param array $spec

@throws MissingAttributeException
Internal function to ensure that all required attributes are available .