Skip to content

Commit

Permalink
Pass $hook & $root variables to action.
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Mar 24, 2016
1 parent 946c280 commit 7068039
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.1.0] -
## [0.1.1] - 2016-03-24
### Added
- Pass `$hook` and `$root` variables to each action.

## [0.1.0] - 2016-03-24
### Added
- Initial release to GitHub.

[0.1.1]: https://github.com/brightnucleus/php-composter/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/brightnucleus/php-composter/compare/v0.0.0...v0.1.0
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ class Example

/**
* Example pre-commit action method.
*
* @var string $hook Name of the hook that was triggered.
* @var string $root Root folder in which the hook was triggered.
*/
public static function preCommit()
public static function preCommit($hook, $root)
{
echo 'PHP Composter Example Pre-Commit Hook' . PHP_EOL;
echo 'Example Pre-Commit Hook ' . $hook . ' @ ' . $root . PHP_EOL;
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion includes/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
ksort($array);
foreach ($array as $methods) {
foreach ($methods as $method) {
$method();
$method($hook, $root);
}
}
}

0 comments on commit 7068039

Please sign in to comment.