Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit cf36248

Browse files
committed
Make README suitable for release without type_structure
1 parent 4ace5bf commit cf36248

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

README.md

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ TypeAssert [![Build Status](https://travis-ci.org/fredemmott/type-assert.svg?bra
33

44
Hack library for converting untyped data to typed data.
55

6-
Status
7-
------
8-
9-
Don't use this yet :) I've written these usage examples before writing
10-
any code...
11-
126
Usage
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

5721
Credit
5822
------

0 commit comments

Comments
 (0)