Skip to content

Commit

Permalink
add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chbach committed Mar 27, 2024
1 parent 20b6962 commit 5ed3990
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
### Usage

```php
$path = __DIR__ . '/fixtures/ifdo-test-v2.0.0.json';
$obj = Ifdo::fromFile($path);

// print errors to console if document is no valid
$obj->setDebug(true);

// check if document is valid
$obj->isValid();

// get list of errors if there are any
$obj->getErrors();

// get full json as array
$obj->getJsonData();

// shorthands to safely access info
$obj->getImageSetHeader();
$obj->getImageSetItems();

// use strict mode trigger exceptions for invalid files
$obj = Ifdo::fromString('{"some": "json"}', true);

// get json encoded string
$obj->toString();
```

### Testing

```bash
Expand Down

0 comments on commit 5ed3990

Please sign in to comment.