Parse table schema to sanitize end explod implicit info.

@param type  $schema
@param mixed $namespace

@return type
351807
public function parseTable(&$table, &$errors = null, $namespace = '\\')
    {
        // for first field no have before
        $before = false;

        // loop throuh fields on table
        foreach ($table as $field => &$notation) {
            $notation = static::getNotationAspects(
                $notation,
                $field,
                $before,
                $errors,
                $namespace
            );
            $before = $field;
        }
    }
1365299
protected function getSchemaFileName($folder, $schema)
    {
        $file = null;

        foreach (['yml', 'yaml'] as $ext) {
            $fileCheck = $folder.'/'.$schema.'.'.$ext;
            if (is_readable($fileCheck)) {
                $file = $fileCheck;
                break;
            }
        }

        if (is_null($file)) {
            throw new SchemaParserException(sprintf('Cannot find schema for "%s" in "%s"', $schema, $folder));
        }

        return $file;
    }
771114
@Nullable
  public static Schema getSchemaOfNamespace (@Nullable final String sNamespace)
  {
    final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace);
    return eDocType == null ? null : eDocType.getSchema ();
  }
523632
public static function typeFromAST(Schema $schema, $inputType)
    {
        if ($inputType instanceof ListType) {
            $innerType = self::typeFromAST($schema, $inputType->get('type'));
            return $innerType ? new ListModifier($innerType) : NULL;
        }

        if ($inputType instanceof NonNullType) {
            $innerType = self::typeFromAST($schema, $inputType->get('type'));
            return $innerType ? new NonNullModifier($innerType) : NULL;
        }

        if (!($inputType instanceof NamedType)) {
            throw new \LogicException('Must be a type name.');
        }

        return $schema->getType($inputType->get('name')->get('value'));
    }
178243
public function columnSql(TableSchema $schema, $name)
    {
        $data = $schema->getColumn($name);
        $typeMap = [
            TableSchema::TYPE_BINARY_UUID => ' BINARY(16)',
            TableSchema::TYPE_UUID => ' CHAR(36)',
            TableSchema::TYPE_TINYINTEGER => ' TINYINT',
            TableSchema::TYPE_SMALLINTEGER => ' SMALLINT',
            TableSchema::TYPE_INTEGER => ' INTEGER',
            TableSchema::TYPE_BIGINTEGER => ' BIGINT',
            TableSchema::TYPE_BOOLEAN => ' BOOLEAN',
            TableSchema::TYPE_FLOAT => ' FLOAT',
            TableSchema::TYPE_DECIMAL => ' DECIMAL',
            TableSchema::TYPE_DATE => ' DATE',
            TableSchema::TYPE_TIME => ' TIME',
            TableSchema::TYPE_DATETIME => ' DATETIME',
            TableSchema::TYPE_TIMESTAMP => ' TIMESTAMP',
            TableSchema::TYPE_JSON => ' TEXT'
        ];

        $out = $this->_driver->quoteIdentifier($name);
        $hasUnsigned = [
            TableSchema::TYPE_TINYINTEGER,
            TableSchema::TYPE_SMALLINTEGER,
            TableSchema::TYPE_INTEGER,
            TableSchema::TYPE_BIGINTEGER,
            TableSchema::TYPE_FLOAT,
            TableSchema::TYPE_DECIMAL
        ];

        if (in_array($data['type'], $hasUnsigned, true) &&
            isset($data['unsigned']) && $data['unsigned'] === true
        ) {
            if ($data['type'] !== TableSchema::TYPE_INTEGER || [$name] !== (array)$schema->primaryKey()) {
                $out .= ' UNSIGNED';
            }
        }

        if (isset($typeMap[$data['type']])) {
            $out .= $typeMap[$data['type']];
        }

        if ($data['type'] === TableSchema::TYPE_TEXT && $data['length'] !== TableSchema::LENGTH_TINY) {
            $out .= ' TEXT';
        }

        if ($data['type'] === TableSchema::TYPE_STRING ||
            ($data['type'] === TableSchema::TYPE_TEXT && $data['length'] === TableSchema::LENGTH_TINY)
        ) {
            $out .= ' VARCHAR';

            if (isset($data['length'])) {
                $out .= '(' . (int)$data['length'] . ')';
            }
        }

        if ($data['type'] === TableSchema::TYPE_BINARY) {
            if (isset($data['length'])) {
                $out .= ' BLOB(' . (int)$data['length'] . ')';
            } else {
                $out .= ' BLOB';
            }
        }

        $integerTypes = [
            TableSchema::TYPE_TINYINTEGER,
            TableSchema::TYPE_SMALLINTEGER,
            TableSchema::TYPE_INTEGER,
        ];
        if (in_array($data['type'], $integerTypes, true) &&
            isset($data['length']) && [$name] !== (array)$schema->primaryKey()
        ) {
                $out .= '(' . (int)$data['length'] . ')';
        }

        $hasPrecision = [TableSchema::TYPE_FLOAT, TableSchema::TYPE_DECIMAL];
        if (in_array($data['type'], $hasPrecision, true) &&
            (isset($data['length']) || isset($data['precision']))
        ) {
            $out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
        }

        if (isset($data['null']) && $data['null'] === false) {
            $out .= ' NOT NULL';
        }

        if ($data['type'] === TableSchema::TYPE_INTEGER && [$name] === (array)$schema->primaryKey()) {
            $out .= ' PRIMARY KEY AUTOINCREMENT';
        }

        if (isset($data['null']) && $data['null'] === true && $data['type'] === TableSchema::TYPE_TIMESTAMP) {
            $out .= ' DEFAULT NULL';
        }
        if (isset($data['default'])) {
            $out .= ' DEFAULT ' . $this->_driver->schemaValue($data['default']);
        }

        return $out;
    }
488940
static function parseParams($params, $schema) {
    $params = (array) $params;

    foreach (array_diff_key($schema, ['_validate' => 1]) as $k => $v) if (preg_match('/^_/', $k)) $params[$k] = $v;

    return $params;
  }
452522
public function visitSchema(Schema $schema)
    {
        return new Schema(
            $this->transformConstraintArray($schema->constraints()),
            $schema->defaultValue(),
            $schema->title(),
            $schema->description()
        );
    }
379982
protected function _generateMetaColumnsSQL($table, $schema)
	{
		if ($schema) {
			return sprintf($this->metaColumnsSQL1, $table, $table, $table, $schema);
		}
		else {
			return sprintf($this->metaColumnsSQL, $table, $table, $schema);
		}
	}
99891
protected function parseLanguage(\stdClass $schema)
    {
        $language = 'english';
        if (!is_object($schema) || !isset($schema->fieldTypes)) {
            return $language;
        }

        foreach ($schema->fieldTypes as $fieldType) {
            if ($fieldType->name !== 'text') {
                continue;
            }
            // we have a text field
            foreach ($fieldType->queryAnalyzer->filters as $filter) {
                if ($filter->class === 'solr.ManagedSynonymGraphFilterFactory') {
                    $language = $filter->managed;
                }
            }
        }

        return $language;
    }
848973
public function getTypesInSchema($schema, Where $where = null)
    {
        $schema_where = Where::create("ns.nspname = $*", [$schema]);
        $where =
            $where === null
            ? $schema_where
            : $where->andWhere($schema_where)
            ;

        return $this->getTypes($where);
    }
912386
public function setSchema($schema)
    {
        $schema = array($schema);
        if (func_num_args() > 0) {
            $schema = func_get_args();
        }
        
        $error = Argument::i();
        foreach ($schema as $i => $name) {
            $error->test($i + 1, 'string');
        }
        
        $schema = implode(',', $schema);
        
        $query = $this->utility()->setSchema($schema);
        $this->query($query);
        
        return $this;
    }
325391
public function initialize($schema, $table=null)
    {
        $mapper = $this->_mapper($schema);
        $table = $table ? $this->_connection($schema)->table($table) : $mapper->table();

        $sequencePool = $this->_connection($schema)->sequencePool();
        $sequencePool->initialize();

        $columns = array();

        // build a map of properties to create
        foreach ($schema->properties() as $prop) {
            $columns[$prop->name] = $prop->type;

            // reset sequences as we go
            if (property_exists($prop->type, 'sequence')) {
                $sequencePool->delete($mapper->sequenceName($prop));
            }
        }

        $table->create($columns);

        return $this;
    }
860783
private function validateSchema(Schema $schema)
    {
        $this->jsonValidator->check(
            json_decode(json_encode($schema->jsonSerialize())),
            json_decode(file_get_contents($schema->getSchema()))
        );

        return $this->jsonValidator->isValid();
    }
1167967
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)
            ));
        }
    }
972653
public function setSchema($schema)
    {
        $schema = func_get_args();
        
        $schema = "'".implode("','", $schema)."'";
        
        $query = $this->getUtilityQuery()->setSchema($schema);
        $this->query($query);
        
        return $this;
    }
506896
public function schemaToNativeClassPath(SchemaDescriptor $schema)
    {
        $path = $this->schemaToNativeNamespace($schema);
        $class = $this->schemaToClassName($schema, true);
        $delim = 'php' === static::LANGUAGE ? '\\' : '/';
        return "{$path}{$delim}{$class}";
    }
567749
public function validateSchema($schema = self::STRICT_SCHEMA)
    {
        $content = file_get_contents($this->path);
        $data = json_decode($content);

        if (null === $data && 'null' !== $content) {
            self::validateSyntax($content, $this->path);
        }

        $schemaFile = __DIR__ . '/../../../res/composer-schema.json';
        $schemaData = json_decode(file_get_contents($schemaFile));

        if ($schema === self::LAX_SCHEMA) {
            $schemaData->additionalProperties = true;
            $schemaData->required = array();
        }

        $validator = new Validator();
        $validator->check($data, $schemaData);

        // TODO add more validation like check version constraints and such, perhaps build that into the arrayloader?

        if (!$validator->isValid()) {
            $errors = array();
            foreach ((array) $validator->getErrors() as $error) {
                $errors[] = ($error['property'] ? $error['property'].' : ' : '').$error['message'];
            }
            throw new JsonValidationException('"'.$this->path.'" does not match the expected JSON schema', $errors);
        }

        return true;
    }