lib/PHPPdf/Core/Parser/BagContainer.php
public static function merge(array $containers)
    {
        $attributeBags = array();

        $weight = 0;
        foreach($containers as $container)
        {
            $weight = max($weight, $container->getWeight());
            $attributeBags[] = $container->getAttributeBag();
        }

        $container = new static();
        $container->attributeBag = AttributeBag::merge($attributeBags);
        $container->weight = $weight;
        
        return $container;
    }
public static function merge(array $containers)
    {
        $attributeBags = array();

        $weight = 0;
        foreach($containers as $container)
        {
            $weight = max($weight, $container->getWeight());
            $attributeBags[] = $container->getAttributeBag();
        }

        $container = new static();
        $container->attributeBag = AttributeBag::merge($attributeBags);
        $container->weight = $weight;
        
        return $container;
    }
public static function merge ( array $ containers ) { $ attributeBags = array ( ) ; $ weight = 0 ; foreach ( $ containers as $ container ) { $ weight = max ( $ weight , $ container -> getWeight ( ) ) ; $ attributeBags [ ] = $ container -> getAttributeBag ( ) ; } $ container = new static ( ) ; $ container -> attributeBag = AttributeBag :: merge ( $ attributeBags ) ; $ container -> weight = $ weight ; return $ container ; }
Marge couple of BagContainers into one object.

Result of merging always is BagContainer.

@param array $containers
@return BagContainer Result of merging
Marge couple of BagContainers into one object .