Skip to content

Commit 85dc08b

Browse files
authored
Add files via upload
1 parent 0e1245b commit 85dc08b

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

src/vennv/vapm/Deferred.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(callable $callback)
4343
}
4444
else
4545
{
46-
throw new DeferedException("Deferred callback must return a Generator");
46+
throw new DeferredException("Deferred callback must return a Generator");
4747
}
4848
}
4949

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/*
4+
* Copyright (c) 2023 VennV
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
declare(strict_types = 1);
26+
27+
namespace vennv\vapm;
28+
29+
use TypeError;
30+
31+
final class DeferredException extends TypeError
32+
{
33+
34+
public function __construct(
35+
protected string $errorMessage,
36+
protected int $errorCode = 0
37+
)
38+
{
39+
parent::__construct(
40+
$this->errorMessage,
41+
$this->errorCode
42+
);
43+
}
44+
45+
public function __toString() : string
46+
{
47+
return __CLASS__ . ": [$this->errorCode]: $this->errorMessage\n";
48+
}
49+
50+
}

0 commit comments

Comments
 (0)