count() public method

public count ( )
Ejemplo n.º 1
0
 /**
  * Reads a line from console, if available. Returns null if not available
  *
  * @return string|null
  */
 public function getLine()
 {
     if ($this->buffer->count() !== 0) {
         return $this->buffer->shift();
     }
     return null;
 }
Ejemplo n.º 2
0
 /**
  * Reads a line from console, if available. Returns null if not available
  *
  * @return string|null
  */
 public function getLine()
 {
     if ($this->buffer->count() !== 0) {
         return $this->buffer->synchronized(function () {
             return $this->buffer->shift();
         });
     }
     return \null;
 }
Ejemplo n.º 3
0
 /**
  * @internal Only call from AsyncPool.php on the main thread
  *
  * @param Server $server
  */
 public function checkProgressUpdates(Server $server)
 {
     while ($this->progressUpdates->count() !== 0) {
         $progress = $this->progressUpdates->shift();
         $this->onProgressUpdate($server, unserialize($progress));
     }
 }