Skip to content

Commit 742e998

Browse files
committed
s/sentinal/sentinel
1 parent 08e4b57 commit 742e998

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/Codegen/Constraints/UntypedBuilder.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
HackBuilderKeys,
1212
HackBuilderValues,
1313
};
14-
use type Slack\Hack\JsonSchema\Sentinal;
14+
use type Slack\Hack\JsonSchema\Sentinel;
1515

1616
type TUntypedSchema = shape(
1717
?'anyOf' => vec<TSchema>,
@@ -169,8 +169,8 @@ private function generateOneOfChecks(vec<TSchema> $schemas, HackBuilder $hb): vo
169169
$hb
170170
->addAssignment('$passed_any', false, HackBuilderValues::export())
171171
->addAssignment('$passed_multi', false, HackBuilderValues::export())
172-
// Use `sentinal` rather than `null` so that it's obvious when we failed to match any constraint.
173-
->addAssignment('$output', Str\format('\%s::get()', Sentinal::class), HackBuilderValues::literal())
172+
// Use `Sentinel` rather than `null` so that it's obvious when we failed to match any constraint.
173+
->addAssignment('$output', Str\format('\%s::get()', Sentinel::class), HackBuilderValues::literal())
174174
->startForeachLoop('$constraints', null, '$constraint')
175175
->startTryBlock()
176176
->addMultilineCall('$output = $constraint', vec['$input', '$pointer'])
@@ -193,7 +193,7 @@ private function generateOneOfChecks(vec<TSchema> $schemas, HackBuilder $hb): vo
193193
);
194194

195195
$hb
196-
->startIfBlockf('$passed_multi || !$passed_any || $output is \%s', Sentinal::class)
196+
->startIfBlockf('$passed_multi || !$passed_any || $output is \%s', Sentinel::class)
197197
->addAssignment(
198198
'$error',
199199
$error,

src/Sentinal.hack renamed to src/Sentinel.hack

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Slack\Hack\JsonSchema;
33
/**
44
* Represents an unset value.
55
*/
6-
final class Sentinal {
6+
final class Sentinel {
77

88
/**
99
* The singleton instance of the sentinal value.

tests/examples/codegen/AddressSchemaValidator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* To re-generate this file run `make test`
66
*
77
*
8-
* @generated SignedSource<<7c546e3edf3430be1044abfffdf398cd>>
8+
* @generated SignedSource<<bbd4e20ed2f469e62e0efcc5610d2ccc>>
99
*/
1010
namespace Slack\Hack\JsonSchema\Tests\Generated;
1111
use namespace Slack\Hack\JsonSchema;
@@ -425,7 +425,7 @@ public static function check(
425425

426426
$passed_any = false;
427427
$passed_multi = false;
428-
$output = \Slack\Hack\JsonSchema\Sentinal::get();
428+
$output = \Slack\Hack\JsonSchema\Sentinel::get();
429429
foreach ($constraints as $constraint) {
430430
try {
431431
$output = $constraint($input, $pointer);
@@ -438,7 +438,7 @@ public static function check(
438438
}
439439
}
440440

441-
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinal) {
441+
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinel) {
442442
$error = shape(
443443
'code' => JsonSchema\FieldErrorCode::FAILED_CONSTRAINT,
444444
'constraint' => shape(

tests/examples/codegen/UntypedSchemaValidator.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* To re-generate this file run `make test`
66
*
77
*
8-
* @generated SignedSource<<8553bd28dc52954a5c87a8c2cb2f3b01>>
8+
* @generated SignedSource<<e7f10e1ede65035fb26f7fa52cba5e5f>>
99
*/
1010
namespace Slack\Hack\JsonSchema\Tests\Generated;
1111
use namespace Slack\Hack\JsonSchema;
@@ -1036,7 +1036,7 @@ public static function check(
10361036

10371037
$passed_any = false;
10381038
$passed_multi = false;
1039-
$output = \Slack\Hack\JsonSchema\Sentinal::get();
1039+
$output = \Slack\Hack\JsonSchema\Sentinel::get();
10401040
foreach ($constraints as $constraint) {
10411041
try {
10421042
$output = $constraint($input, $pointer);
@@ -1049,7 +1049,7 @@ public static function check(
10491049
}
10501050
}
10511051

1052-
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinal) {
1052+
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinel) {
10531053
$error = shape(
10541054
'code' => JsonSchema\FieldErrorCode::FAILED_CONSTRAINT,
10551055
'constraint' => shape(
@@ -1099,7 +1099,7 @@ public static function check(
10991099

11001100
$passed_any = false;
11011101
$passed_multi = false;
1102-
$output = \Slack\Hack\JsonSchema\Sentinal::get();
1102+
$output = \Slack\Hack\JsonSchema\Sentinel::get();
11031103
foreach ($constraints as $constraint) {
11041104
try {
11051105
$output = $constraint($input, $pointer);
@@ -1112,7 +1112,7 @@ public static function check(
11121112
}
11131113
}
11141114

1115-
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinal) {
1115+
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinel) {
11161116
$error = shape(
11171117
'code' => JsonSchema\FieldErrorCode::FAILED_CONSTRAINT,
11181118
'constraint' => shape(
@@ -1191,7 +1191,7 @@ public static function check(
11911191

11921192
$passed_any = false;
11931193
$passed_multi = false;
1194-
$output = \Slack\Hack\JsonSchema\Sentinal::get();
1194+
$output = \Slack\Hack\JsonSchema\Sentinel::get();
11951195
foreach ($constraints as $constraint) {
11961196
try {
11971197
$output = $constraint($input, $pointer);
@@ -1204,7 +1204,7 @@ public static function check(
12041204
}
12051205
}
12061206

1207-
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinal) {
1207+
if ($passed_multi || !$passed_any || $output is \Slack\Hack\JsonSchema\Sentinel) {
12081208
$error = shape(
12091209
'code' => JsonSchema\FieldErrorCode::FAILED_CONSTRAINT,
12101210
'constraint' => shape(

0 commit comments

Comments
 (0)