Skip to content

Commit

Permalink
Add note about indentation of first line
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Feb 10, 2021
1 parent d98f6a1 commit 05241f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Export the current value of each `use()` variable as expression inside the expor
You can use the 3rd argument of `VarExporter::export()` to control the indentation level.
This is useful when you want to use the generated code string to replace a placeholder in a template used to generate code files.

So using output of `VarExporter::export(['foo' => 'bar'], indentLevel: 1)` in the template below to replace `{{exported}}`
So using output of `VarExporter::export(['foo' => 'bar'], indentLevel: 1)` in the template below to replace `{{exported}}`:

```
public foo()
Expand All @@ -511,7 +511,7 @@ public foo()
}
```

would result in
would result in:

```php
public foo()
Expand All @@ -522,6 +522,8 @@ public foo()
}
```

Note that the first line will never be indented, as we can see in the example above.

## Error handling

Any error occurring on `export()` will throw an `ExportException`:
Expand Down

0 comments on commit 05241f2

Please sign in to comment.