lib/PHPPdf/Core/AttributeBag.php
public static function merge(array $bags)
    {
        $mergedBag = new static();

        foreach($bags as $bag)
        {
            foreach($bag->getAll() as $name => $value)
            {
                $mergedBag->add($name, $value);
            }
        }

        return $mergedBag;
    }
public static function merge(array $bags)
    {
        $mergedBag = new static();

        foreach($bags as $bag)
        {
            foreach($bag->getAll() as $name => $value)
            {
                $mergedBag->add($name, $value);
            }
        }

        return $mergedBag;
    }
public static function merge ( array $ bags ) { $ mergedBag = new static ( ) ; foreach ( $ bags as $ bag ) { foreach ( $ bag -> getAll ( ) as $ name => $ value ) { $ mergedBag -> add ( $ name , $ value ) ; } } return $ mergedBag ; }
Merge couple of bags into one.

Type of return object depends on invocation context. Return object is as same
type as class used in invocation (late state binding).

@param array $bags Array of Bag objects
@return Bag Single Bag object contains merged data
Merge couple of bags into one .