Skip to content

Commit 02ec6aa

Browse files
committed
Updated to 1.0.2 version
1 parent fe3ad84 commit 02ec6aa

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# CHANGELOG
22

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

6-
* Added `Josantonius\Hook\Hook::removeHook()` method.
6+
* Added `Josantonius\Hook\Hook::resetHook()` method.
77

88
## 1.0.1 - 2017-03-18
99
* Some files were excluded from download and comments and readme files were updated.

src/Hook.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ public static function addHook($where, $function = '') {
150150
}
151151

152152
/**
153-
* Remove custom function to hook.
153+
* Reset custom function to hook.
154154
*
155-
* @since 1.0.0
155+
* @since 1.0.2
156156
*
157-
* @param array|string $where → hook to remove
157+
* @param array|string $where → hook to remove
158158
*
159159
* @return boolean
160160
*/
161-
public static function removeHook($where) {
161+
public static function resetHook($where) {
162162

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

165-
unset(self::$_hooks[$where]);
165+
self::$_hooks[$where] = '';
166166

167167
return true;
168168
}
@@ -198,8 +198,6 @@ public static function run($where, $args='') {
198198

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

201-
unset(self::$_hooks[$where]);
202-
203201
foreach ($theseHooks as $hook) {
204202

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

0 commit comments

Comments
 (0)