/** * {@inheritdoc} */ public function progress(SourceInterface $source) { $state = $source->getState($this); if (!empty($state->total)) { return (double) ($state->total - count($state->files)) / $state->total; } return ProgressInterface::COMPLETE; }
/** * {@inheritdoc} */ public function progress(SourceInterface $source) { $state = $source->getState($this); if (!empty($state->fileLength)) { return (double) $state->pointer / $state->fileLength; } return ProgressInterface::COMPLETE; }
/** * {@inheritdoc} */ public function progress(SourceInterface $source) { $state = $source->getState($this); if (empty($state->total) || $state->pointer >= $state->total) { return ProgressInterface::COMPLETE; } return (double) $state->pointer / $state->total; }