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 57a718b commit 62facef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ composer require std-library/type-guard
## Usage

- [`asInt()`](#asint)
- [`asFloat()`](#asfloat)
- [`asString()`](#asstring)

### `asInt()`
Expand All @@ -47,6 +48,14 @@ Asserts and narrows down the type of the given variable to an integer.
$variable = type($variable)->asInt();
```

### `asFloat()`

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

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

### `asString()`

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

0 comments on commit 62facef

Please sign in to comment.