public function execute()
    {
        // sort jobs by priority
        $jobs = [];
        ksort($this->jobs);
        foreach ($this->jobs as $priority_jobs) {
            $jobs = array_merge($jobs, $priority_jobs);
        }

        /* @var $job Job */
        foreach ($jobs as $job) {
            $job->execute();
        }
    }
public function execute()
    {
        // sort jobs by priority
        $jobs = [];
        ksort($this->jobs);
        foreach ($this->jobs as $priority_jobs) {
            $jobs = array_merge($jobs, $priority_jobs);
        }

        /* @var $job Job */
        foreach ($jobs as $job) {
            $job->execute();
        }
    }
public function execute ( ) { // sort jobs by priority $ jobs = [ ] ; ksort ( $ this -> jobs ) ; foreach ( $ this -> jobs as $ priority_jobs ) { $ jobs = array_merge ( $ jobs , $ priority_jobs ) ; } /* @var $job Job */ foreach ( $ jobs as $ job ) { $ job -> execute ( ) ; } }
Execute all jobs.
Execute all jobs .