protected function mergeSchemaObjectArrays($parent, $schema)
    {
        // Directives used that exist in the schema being extended, that are arrays, should be merged.
        foreach (array_intersect_key($schema, $parent) as $key => $value) {
            # Simple merge on non-multidimensional arrays...
            if (is_array($value) && count($value) === count($value, COUNT_RECURSIVE)) {
                $schema[$key] = array_merge($parent[$key], $value);
            # Recursive merge on multidimensional arrays...
            } elseif (is_array($value)) {
                $schema[$key] = array_merge_recursive($parent[$key], $value);
            }
        }
        
        // Directives in the parent that have not been defined should be added.
        return array_replace($schema, array_diff_key($parent, $schema));
    }