Skip to content

Commit

Permalink
Merge pull request #3 from ajgarlag/function-arguments
Browse files Browse the repository at this point in the history
Allow to inspect function arguments
  • Loading branch information
ajgarlag committed Mar 31, 2016
2 parents c7965eb + 24c32b6 commit d8a9878
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added
- Add `$environment` and `$context` variables
- Allow to inspect function arguments

## [0.2.0] - 2016-03-10

Expand Down
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -52,6 +52,22 @@ Once registered, you can call the new `breakpoint` function:

Once stopped, your debugger will allow you to inspect the `$environment` and `$context` variables.

### Function arguments

Any argument passed to the twig function will be added to the `$arguments` array, so you can inspect it easily.

```twig
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
</head>
<body>
{{ breakpoint(app.user, app.session) }}
</body>
</html>
```

Symfony Bundle
--------------
Expand Down
1 change: 1 addition & 0 deletions src/BreakpointExtension.php
Expand Up @@ -40,6 +40,7 @@ public function getFunctions()
public function setBreakpoint(Twig_Environment $environment, $context)
{
if (function_exists('xdebug_break')) {
$arguments = array_slice(func_get_args(), 2);
xdebug_break();
}
}
Expand Down

0 comments on commit d8a9878

Please sign in to comment.