This repository was archived by the owner on Sep 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-37
lines changed
Expand file tree Collapse file tree 1 file changed +1
-37
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,6 @@ TypeAssert [ I've written these usage examples before writing
10- any code...
11-
126Usage
137-----
148
@@ -22,37 +16,7 @@ function main(mixed $foo): void {
2216}
2317```
2418
25- ``` Hack
26- <?hh
27- class Foo {
28- const TAPIResponse = shape(
29- 'id' => int,
30- 'user' => string,
31- 'data' => shape(
32- /* ... */
33- ),
34- );
35-
36- public static function getAPIResponse(): self::TAPIResponse {
37- $json_string = file_get_contents('https://api.example.com');
38- $array = json_decode($json_string, /* associative = */ true);
39- return TypeAssert::isTypeStructure(
40- type_structure(self::class, 'TAPIResponse'),
41- $array,
42- );
43- }
44- }
45- ```
46-
47- WARNING
48- -------
49-
50- ` TypeStructure<T> ` and the ` type_structure() ` API are experimental
51- features of HHVM, and not supported. Expect them to break with some future
52- HHVM release.
53-
54- This library uses them anyway as there is not currently an alternative
55- way to do this.
19+ See [ the TypeAssert class] ( https://github.com/fredemmott/type-assert/blob/master/src/TypeAssert.php ) for full API.
5620
5721Credit
5822------
You can’t perform that action at this time.
0 commit comments