Exemplo n.º 1
0
 /**
  * {@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;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function progress(SourceInterface $source)
 {
     $state = $source->getState($this);
     if (!empty($state->fileLength)) {
         return (double) $state->pointer / $state->fileLength;
     }
     return ProgressInterface::COMPLETE;
 }
Exemplo n.º 3
0
 /**
  * {@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;
 }