tick(); if ($sleep) usleep($sleep); } $notify->finish(); } function test_notify_msg(cli\Notify $notify, $cycle = 1000000, $sleep = null) { $notify->display(); for ($i = 0; $i < $cycle; $i++) { // Sleep before tick to simulate time-intensive work and give time // for the initial message to display before it is changed if ($sleep) usleep($sleep); $msg = sprintf(' Finished step %d', $i + 1); $notify->tick(1, $msg); } $notify->finish(); }