Skip to content

Commit

Permalink
Complex README
Browse files Browse the repository at this point in the history
  • Loading branch information
BadJacky committed Jul 3, 2024
1 parent 2c28a56 commit 44b0c44
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ composer require badjacky/basic-type
Here is a basic usage example:

```php
use BadJacky\BasicType\Assert;
use function BadJacky\BasicType\type;


// Example usage
Assert::string($value);
Assert::integer($value);
type(1)->asInt(); // 1
type(['a'])->asArray(); // ['a']
type('string')->asString(); // 'string'
type(1.1)->asFloat(); // 1.1
type(true)->asBool(); // true
type(null)->asNull(); // null
type(new stdClass())->asObject(); // stdClass

```

## Testing
Expand Down

0 comments on commit 44b0c44

Please sign in to comment.