Пример #1
0
 /**
  * @param int|string $type
  */
 public function __construct($type)
 {
     if (is_int($type)) {
         $message = sprintf('%d does not correspond to a valid record type (must be between 0 and 65535).', $type);
     } else {
         $message = sprintf('"%s" does not name a valid record type.', $type);
     }
     parent::__construct($message);
     $this->type = $type;
 }
Пример #2
0
 /**
  * @param callable $callable
  * @param \Throwable $previous
  */
 public function __construct(callable $callable, \Throwable $previous)
 {
     parent::__construct('The callable threw an exception or did not return a Generator.', 0, $previous);
     $this->callable = $callable;
 }
Пример #3
0
 /**
  * @param string $message
  * @param callable $callable
  * @param \Throwable|null $previous
  */
 public function __construct(callable $callable, \Throwable $previous = null)
 {
     parent::__construct('Invalid observable emitter.', 0, $previous);
     $this->callable = $callable;
 }
Пример #4
0
 /**
  * @param int $signo
  */
 public function __construct(int $signo)
 {
     parent::__construct(sprintf('Invalid signal number: %d.', $signo));
 }
Пример #5
0
 /**
  * @param \Icicle\Awaitable\Awaitable $awaitable
  */
 public function __construct(Awaitable $awaitable)
 {
     parent::__construct('Awaitable returned from Coroutine. Use "return yield $awaitable;" to return the fulfillment value of $awaitable.');
     $this->awaitable = $awaitable;
 }
Пример #6
0
 /**
  * @param callable $resolver
  */
 public function __construct(callable $resolver)
 {
     parent::__construct('The resolver must return a callable or null.');
     $this->resolver = $resolver;
 }
Пример #7
0
 /**
  * @param \Generator $generator
  */
 public function __construct(\Generator $generator)
 {
     parent::__construct('Generator returned from Coroutine. Use "return yield from $coroutine;" to return the fulfillment value of $coroutine.');
     $this->generator = $generator;
 }