classJsonResponse
final class JsonResponse
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.The response of an ON EMPTY or ON ERROR clause: raise an error, return NULL, or return a default literal.
The holder of the clause derives the default and writes ON EMPTY or ON ERROR. Source: https://dev.mysql.com/doc/refman/8.4/en/json-search-functions.html#function_json-value, https://dev.mysql.com/doc/refman/8.4/en/json-table-functions.html.
$response = new \SqlSemantics\Platform\MySql\Statement\Call\Json\JsonResponse(\SqlSemantics\Platform\MySql\Statement\Call\Json\JsonResponseKind::Default, new \SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral('0'));
$response->default?->text // => '0'new \SqlSemantics\Platform\MySql\Statement\Call\Json\JsonResponse(\SqlSemantics\Platform\MySql\Statement\Call\Json\JsonResponseKind::Null, new \SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral('0')) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstructionProperties§
public JsonResponseKind $kindpublic Scalar|null $default = nullMethods§
public function __construct(public JsonResponseKind $kind, public Scalar|null $default = null)Parameters
$kind | JsonResponseKind | The response |
$default | Scalar|null | The literal of DEFAULT; present exactly for DEFAULT |
Calls 2
- static-call Check::input() line 37
- class-const JsonResponseKind::Default() line 37
public function render(Output $out): voidTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 4
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Call\JsonRule::response() packages/sql-semantics-mysql/src/Lowering/Call/JsonRule.php:117
- new SqlSemantics\Platform\MySql\Lowering\Call\JsonRule::response() packages/sql-semantics-mysql/src/Lowering/Call/JsonRule.php:118
- new SqlSemantics\Platform\MySql\Lowering\Call\JsonRule::response() packages/sql-semantics-mysql/src/Lowering/Call/JsonRule.php:119
Type declarations 5
- type SqlSemantics\Platform\MySql\Lowering\Call\JsonRule packages/sql-semantics-mysql/src/Lowering/Call/JsonRule.php:110
- type SqlSemantics\Platform\MySql\Statement\Call\Json\JsonValueCall packages/sql-semantics-mysql/src/Statement/Call/Json/JsonValueCall.php:53
- type SqlSemantics\Platform\MySql\Statement\Call\Json\JsonValueCall packages/sql-semantics-mysql/src/Statement/Call/Json/JsonValueCall.php:54
- type SqlSemantics\Platform\MySql\Statement\Call\Json\PathColumn packages/sql-semantics-mysql/src/Statement/Call/Json/PathColumn.php:61
- type SqlSemantics\Platform\MySql\Statement\Call\Json\PathColumn packages/sql-semantics-mysql/src/Statement/Call/Json/PathColumn.php:62