AST.php
2 months ago
ASTDefinitionBuilder.php
2 months ago
BreakingChangesFinder.php
2 months ago
BuildClientSchema.php
2 months ago
BuildSchema.php
2 months ago
InterfaceImplementations.php
2 months ago
LazyException.php
2 months ago
LexicalDistance.php
2 months ago
MixedStore.php
2 months ago
PairSet.php
2 months ago
PhpDoc.php
2 months ago
SchemaExtender.php
2 months ago
SchemaPrinter.php
2 months ago
TypeComparators.php
2 months ago
TypeInfo.php
2 months ago
Utils.php
2 months ago
Value.php
2 months ago
LazyException.php
16 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Vendor\GraphQL\Utils; |
| 4 | |
| 5 | /** |
| 6 | * Allows lazy calculation of a complex message when the exception is used in `assert()`. |
| 7 | */ |
| 8 | class LazyException extends \Exception |
| 9 | { |
| 10 | /** @param callable(): string $makeMessage */ |
| 11 | public function __construct(callable $makeMessage) |
| 12 | { |
| 13 | parent::__construct($makeMessage()); |
| 14 | } |
| 15 | } |
| 16 |