Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
faissaloux committed Mar 30, 2024
1 parent 98cc39d commit 74a7cca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ $variable = type($variable)->asInt();

### `asString()`

Asserts and narrows down the type of the given variable to an string.
Asserts and narrows down the type of the given variable to a string.

```php
$variable = type($variable)->asString();
```

### `asBool()`

Asserts and narrows down the type of the given variable to a boolean.

```php
$variable = type($variable)->asBool();
```

------

**Type Guard** was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

0 comments on commit 74a7cca

Please sign in to comment.