[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/guzzlehttp/ringphp/src/Future/ -> MagicFutureTrait.php (source)

   1  <?php
   2  namespace GuzzleHttp\Ring\Future;
   3  
   4  /**
   5   * Implements common future functionality that is triggered when the result
   6   * property is accessed via a magic __get method.
   7   *
   8   * @property mixed $_value Actual data used by the future. Accessing this
   9   *     property will cause the future to block if needed.
  10   */
  11  trait MagicFutureTrait
  12  {
  13      use BaseFutureTrait;
  14  
  15      /**
  16       * This function handles retrieving the dereferenced result when requested.
  17       *
  18       * @param string $name Should always be "data" or an exception is thrown.
  19       *
  20       * @return mixed Returns the dereferenced data.
  21       * @throws \RuntimeException
  22       * @throws \GuzzleHttp\Ring\Exception\CancelledException
  23       */
  24      public function __get($name)
  25      {
  26          if ($name !== '_value') {
  27              throw new \RuntimeException("Class has no {$name} property");
  28          }
  29  
  30          return $this->_value = $this->wait();
  31      }
  32  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1