Skip to content

Commit

Permalink
Updated to 1.0.2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
josantonius committed May 19, 2017
1 parent fe3ad84 commit 02ec6aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# CHANGELOG

## 1.0.3 - 2017-05-19
## 1.0.2 - 2017-05-19
* Added option to remove custom function to hook.

* Added `Josantonius\Hook\Hook::removeHook()` method.
* Added `Josantonius\Hook\Hook::resetHook()` method.

## 1.0.1 - 2017-03-18
* Some files were excluded from download and comments and readme files were updated.
Expand Down
12 changes: 5 additions & 7 deletions src/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ public static function addHook($where, $function = '') {
}

/**
* Remove custom function to hook.
* Reset custom function to hook.
*
* @since 1.0.0
* @since 1.0.2
*
* @param array|string $where → hook to remove
* @param array|string $where → hook to remove
*
* @return boolean
*/
public static function removeHook($where) {
public static function resetHook($where) {

if (isset(self::$_hooks[$where])) {

unset(self::$_hooks[$where]);
self::$_hooks[$where] = '';

return true;
}
Expand Down Expand Up @@ -198,8 +198,6 @@ public static function run($where, $args='') {

$theseHooks = explode('|', self::$_hooks[$where]);

unset(self::$_hooks[$where]);

foreach ($theseHooks as $hook) {

if (preg_match("/@/i", $hook)) {
Expand Down

0 comments on commit 02ec6aa

Please sign in to comment.