LdapTools\Schema\Parser\SchemaYamlParser::validateSchemaType PHP Method

validateSchemaType() protected method

Validates some of the schema values to check that they are allowed.
protected validateSchemaType ( LdapObjectSchema $schema, array $schemaArray )
$schema LdapTools\Schema\LdapObjectSchema
$schemaArray array
    protected function validateSchemaType(LdapObjectSchema $schema, array $schemaArray)
    {
        if (!(bool) count(array_filter(array_keys($schemaArray['attributes']), 'is_string'))) {
            throw new SchemaParserException('The attributes for a schema should be an associative array.');
        }
        if ($schema->getScope() && !in_array($schema->getScope(), QueryOperation::SCOPE)) {
            throw new SchemaParserException(sprintf('The scope "%s" is not valid. Valid types are: %s', $schema->getScope(), implode(', ', QueryOperation::SCOPE)));
        }
    }