Merge a set of attribute preprocessors into this collection

@param array|AttributePreprocessorCollection $attributePreprocessors Instance of AttributePreprocessorCollection or 2D array of [[attrName,regexp|AttributePreprocessor]]
484329
public function merge($attributePreprocessors)
	{
		$error = false;

		if ($attributePreprocessors instanceof AttributePreprocessorCollection)
		{
			foreach ($attributePreprocessors as $attrName => $attributePreprocessor)
			{
				$this->add($attrName, $attributePreprocessor->getRegexp());
			}
		}
		elseif (is_array($attributePreprocessors))
		{
			// This should be a list where each element is a [attrName,regexp] pair, or
			// [attrName,AttributePreprocessor]
			foreach ($attributePreprocessors as $values)
			{
				if (!is_array($values))
				{
					$error = true;
					break;
				}

				list($attrName, $value) = $values;

				if ($value instanceof AttributePreprocessor)
				{
					$value = $value->getRegexp();
				}

				$this->add($attrName, $value);
			}
		}
		else
		{
			$error = true;
		}

		if ($error)
		{
			throw new InvalidArgumentException('merge() expects an instance of AttributePreprocessorCollection or a 2D array where each element is a [attribute name, regexp] pair');
		}
	}
63680
protected function deep_merge_recursive($arrays)
    {
        $result = array();

        foreach ($arrays as $array)
        {
            foreach ($array as $key => $value)
            {
                if (is_integer($key))
                {
                    $result[] = $value;
                }
                elseif (isset($result[$key]) && is_array($result[$key]) && is_array($value))
                {
                    $result[$key] = $this->deep_merge_recursive(array($result[$key], $value));
                }
                // handle embeded object with object value
                elseif (isset($result[$key]) && is_object($result[$key]) && is_object($value))
                {
                    $result[$key] = (object)$this->deep_merge_recursive(array((array)$result[$key], (array)$value));
                }
                // handle embeded object with array value
                elseif (isset($result[$key]) && is_object($result[$key]) && is_array($value))
                {
                    $result[$key] = (object)$this->deep_merge_recursive(array((array)$result[$key], $value));
                }
                else
                {
                    $result[$key] = $value;
                }
            }
        }

        return $result;
    }
45493
protected static function executeAttributePreprocessor(Tag $tag, $attrName, $regexp, $map)
	{
		$attrValue = $tag->getAttribute($attrName);
		$captures  = self::getNamedCaptures($attrValue, $regexp, $map);
		foreach ($captures as $k => $v)
		{
			// Attribute preprocessors cannot overwrite other attributes but they can
			// overwrite themselves
			if ($k === $attrName || !$tag->hasAttribute($k))
			{
				$tag->setAttribute($k, $v);
			}
		}
	}
831533
protected function mergeLastGroupAttributes(array $attributes)
    {
        if (empty($this->groupStack)) {
            return $this->mergeGroup($attributes, []);
        }

        return $this->mergeGroup($attributes, end($this->groupStack));
    }
1001188
public static function mergeAttributes()
    {
        $attributes = call_user_func_array('array_merge_recursive', func_get_args());

        foreach ($attributes as $attribute => &$value) {
            if (is_array($value)) {
                $value = join(' ', array_flatten($value));
            }
        }

        return $attributes;
    }
258712
public function getAttributes(array $attribute_names = [], array $types = [])
    {
        $attribute_map = [];

        if (empty($attribute_names)) {
            $attribute_map = $this->attribute_map->getItems();
        } else {
            foreach ($attribute_names as $attribute_name) {
                $attribute_map[$attribute_name] = $this->getAttribute($attribute_name);
            }
        }

        if (!empty($types)) {
            $attribute_map = array_filter(
                $attribute_map,
                function ($attribute) use ($types) {
                    return in_array(get_class($attribute), $types);
                }
            );
        }

        return new AttributeMap($attribute_map);
    }
308575
protected function _mergeAttr(array $attrs = array(), $val = null, $key = 'class')
    {
        if (Arr::key($key, $attrs)) {
            $attrs[$key] .= ' ' . $val;
        } else {
            $attrs[$key] = $val;
        }
        return $attrs;
    }
852137
protected function mergeContextPropertiesWithDefaults(array $contextProperties)
    {
        $contextProperties = $this->removeDeprecatedProperties($contextProperties);

        $defaultContextProperties = [
            'workspaceName' => 'live',
            'currentDateTime' => $this->now,
            'dimensions' => [],
            'targetDimensions' => [],
            'invisibleContentShown' => false,
            'removedContentShown' => false,
            'inaccessibleContentShown' => false
        ];

        $mergedProperties = Arrays::arrayMergeRecursiveOverrule($defaultContextProperties, $contextProperties, true);

        $this->mergeDimensionValues($contextProperties, $mergedProperties);
        $this->mergeTargetDimensionContextProperties($contextProperties, $mergedProperties, $defaultContextProperties);

        return $mergedProperties;
    }
1086098
public function merge( array $attributes ) {
		foreach ( $attributes as $name => $value ) {
			$this->set_attribute( $name, $value );
		}

		return $this;
	}
1063149
public function data_preprocessing(&$defaultvalues) {
        parent::data_preprocessing($defaultvalues);
        $defaultvalues['completionentriesenabled'] = !empty($defaultvalues['completionentries']) ? 1 : 0;
        if (empty($defaultvalues['completionentries'])) {
            $defaultvalues['completionentries'] = 1;
        }
    }
270976
public function mergeDimensions($newDimensions)
    {
        $newDimensions = $this->convertToArrayIfString($newDimensions);

        $this->dimensions = $this->mergeNewDimensionsToCurrentOnes($newDimensions);
    }
562514
@Override
    public void preProcess(DataSet toPreProcess) {
        for (DataSetPreProcessor preProcessor : preProcessors) {
            preProcessor.preProcess(toPreProcess);
        }
    }
1065532
public function add($attrName, $regexp)
	{
		$attrName = AttributeName::normalize($attrName);

		$k = serialize([$attrName, $regexp]);
		$this->items[$k] = new AttributePreprocessor($regexp);

		return $this->items[$k];
	}
1138004
public function mergeAttributeLabels($labels)
    {
        if (!isset(static::$mergedLabels[static::class])) {
            $default = $this->defaultAttributeLabels();
            foreach ($this->attributes() as $k) {
                $label = $labels[$k] ?: $default[$k];
                if (!$label) {
                    if (preg_match('/(.+)_[a-z]+$/', $k, $m)) {
                        if (isset($labels[$m[1]])) {
                            $label = $labels[$m[1]];
                        }
                    }
                }
                if (!$label) {
                    $toTranslate = preg_replace(['/_id$/', '/_label$/', '/_ids$/', '/_like$/'], [' ID', '', ' IDs', ''], $k);
                    $toTranslate = preg_replace('/_/', ' ', $toTranslate);
                    $label = Yii::t(static::$i18nDictionary, ucfirst($toTranslate));
                }
                $labels[$k] = $label;
            }
            static::$mergedLabels[static::class] = $labels;
        }

        return static::$mergedLabels[static::class];
    }
122853
protected function mergeConfigWithDefaults($preset)
    {
        // Get the preset settings
        if (!$settings = Config::get('decoy.encode.presets.'.$preset.'.settings')) {
            throw new Exception('Encoding preset not found: '.$preset);
        }

        // If the settings are an assoc array, then there is only one output and it
        // needs to be wrapped in an array
        if (!is_numeric(array_keys($settings)[0])) {
            $settings = ['mp4' => $settings];
        }

        // Merge defaults with each output in the settings
        return array_map(function ($output) {
            return array_merge($this->defaults, $output);
        }, $settings);
    }
1016267
public function addProcessors(array $processors)
    {
        foreach ($processors as $key => $processor) {
            $this->addProcessor($processor, $key);
        }
        return $this;
    }
1012764
public function attributes($attributes) {
        
        if(false === is_array($attributes)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
        }

        $this -> attributes = array_merge($this -> attributes, $attributes);

        return $this;
    }