PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.6 28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 All 130 releases
← All changes | vendor_prefixed/guzzlehttp/promises/src/EachPromise.php +16 -0 27.6 → trunk View file →
@@ -47,8 +47,12 @@
47 47 * @param array $config Configuration options
48 48 */
49 49 public function __construct($iterable, array $config = [])
50 50 {
51 + if (!\is_iterable($iterable)) {
52 + \YoastSEO_Vendor\trigger_deprecation('guzzlehttp/promises', '2.5', 'Passing a non-iterable to %s::%s() is deprecated; guzzlehttp/promises 3.0 will require an iterable.', __CLASS__, __FUNCTION__);
53 + $iterable = [$iterable];
54 + }
51 55 $this->iterable = \YoastSEO_Vendor\GuzzleHttp\Promise\Create::iterFor($iterable);
52 56 if (isset($config['concurrency'])) {
53 57 $this->concurrency = $config['concurrency'];
54 58 }
@@ -69,8 +73,20 @@
69 73 $this->createPromise();
70 74 /** @psalm-assert Promise $this->aggregate */
71 75 $this->iterable->rewind();
72 76 $this->refillPending();
77 + if (!$this->pending) {
78 + \YoastSEO_Vendor\GuzzleHttp\Promise\Utils::queue()->add(function () : void {
79 + if (!$this->aggregate || \YoastSEO_Vendor\GuzzleHttp\Promise\Is::settled($this->aggregate)) {
80 + return;
81 + }
82 + try {
83 + $this->checkIfFinished();
84 + } catch (\Throwable $e) {
85 + $this->aggregate->reject($e);
86 + }
87 + });
88 + }
73 89 } catch (\Throwable $e) {
74 90 $this->aggregate->reject($e);
75 91 }
76 92 /**