public static function build(array $subscribers = [], $totalItems = self::UNKNOWN)
    {
        // New object
        $that = new static($totalItems);

        // Register subscribers
        foreach ($subscribers as $subscriber) {
            $that->addSubscriber($subscriber);
        }

        // Return it
        return $that;
    }
public static function build(array $subscribers = [], $totalItems = self::UNKNOWN)
    {
        // New object
        $that = new static($totalItems);

        // Register subscribers
        foreach ($subscribers as $subscriber) {
            $that->addSubscriber($subscriber);
        }

        // Return it
        return $that;
    }
public static function build ( array $ subscribers = [ ] , $ totalItems = self :: UNKNOWN ) { // New object $ that = new static ( $ totalItems ) ; // Register subscribers foreach ( $ subscribers as $ subscriber ) { $ that -> addSubscriber ( $ subscriber ) ; } // Return it return $ that ; }
Build a task tracker using a list of subscribers

This is an alternate constructor, to be used when constructing a
Tracker object using a collection of subscribers

@param array|EventSubscriberInterface[] $subscribers
@param int                              $totalItems
@return static
Build a task tracker using a list of subscribers