protected function getParentSchemaObject(array $objectSchema, $schemaName)
    {
        if (isset($objectSchema['extends_default'])) {
            $parent = $this->getExtendedDefaultSchemaObject($objectSchema);
        } elseif (isset($objectSchema['extends']) && is_string($objectSchema['extends'])) {
            $parent = $this->getObjectFromSchema($this->schemas[$this->schemaFolder][$schemaName], $objectSchema['extends']);
        } elseif (isset($objectSchema['extends']) && is_array($objectSchema['extends']) && 2 == count($objectSchema['extends'])) {
            $name = reset($objectSchema['extends']);
            $type = $objectSchema['extends'][1];
            $this->parseAll($name);
            $parent = $this->getObjectFromSchema($this->schemas[$this->schemaFolder][$name], $type);
        } else {
            throw new SchemaParserException('The directive "extends" must be a string or array with exactly 2 values.');
        }

        return $parent;
    }