PluginProbe
Smart Grid-Layout Design for Contact Form 7 / 3.3.2
Smart Grid-Layout Design for Contact Form 7 v3.3.2
4.18.0 4.17.0 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 4.0.0 4.0.1 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10 4.11 4.12 4.13 4.14 All 119 releases
cf7-grid-layout / assets / simple-html-dom / amphp / amp / lib / InvalidYieldError.php

InvalidYieldError.php in Smart Grid-Layout Design for Contact Form 7 3.3.2, at assets/simple-html-dom/amphp/amp/lib/InvalidYieldError.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Amp;
4
5 class InvalidYieldError extends \Error
6 {
7 /**
8 * @param \Generator $generator
9 * @param string $prefix
10 * @param \Throwable|null $previous
11 */
12 public function __construct(\Generator $generator, string $prefix, \Throwable $previous = null)
13 {
14 $yielded = $generator->current();
15 $prefix .= \sprintf(
16 "; %s yielded at key %s",
17 \is_object($yielded) ? \get_class($yielded) : \gettype($yielded),
18 \var_export($generator->key(), true)
19 );
20
21 if (!$generator->valid()) {
22 parent::__construct($prefix, 0, $previous);
23 return;
24 }
25
26 $reflGen = new \ReflectionGenerator($generator);
27 $exeGen = $reflGen->getExecutingGenerator();
28 if ($isSubgenerator = ($exeGen !== $generator)) {
29 $reflGen = new \ReflectionGenerator($exeGen);
30 }
31
32 parent::__construct(\sprintf(
33 "%s on line %s in %s",
34 $prefix,
35 $reflGen->getExecutingLine(),
36 $reflGen->getExecutingFile()
37 ), 0, $previous);
38 }
39 }
40