Pantheon\Terminus\Collections\Workflows::lastFinishedAt PHP Метод

lastFinishedAt() публичный Метод

Get timestamp of most recently finished workflow
public lastFinishedAt ( ) : integer | null
Результат integer | null Timestamp
    public function lastFinishedAt()
    {
        $workflows = $this->all();
        usort($workflows, function ($a, $b) {
            $a_finished_after_b = $a->get('finished_at') >= $b->get('finished_at');
            if ($a_finished_after_b) {
                $cmp = -1;
            } else {
                $cmp = 1;
            }
            return $cmp;
        });
        if (count($workflows) > 0) {
            $timestamp = $workflows[0]->get('finished_at');
        } else {
            $timestamp = null;
        }
        return $timestamp;
    }