Skip to content

Commit c74fab8

Browse files
committed
Update README.md: replace Hookable::addAction and Hookable::addFilter with Hookable::action and Hookable::filter for consistency
1 parent e8268f9 commit c74fab8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Actions are hooks that do not modify data. You can add an action like this:
2525

2626
```php
2727
use SaschaEnde\Hookable\Facades\Hookable;
28-
Hookable::addAction('my_action', function ($arg1, $arg2) {
28+
Hookable::action('my_action', function ($arg1, $arg2) {
2929
// Do something with $arg1 and $arg2
3030
});
3131
```
3232

3333
You can then trigger the action like this:
3434

3535
```php
36-
Hookable::doAction('my_action', $arg1, $arg2);
36+
Hookable::action('my_action', $arg1, $arg2);
3737
```
3838

3939
#### Filters
@@ -42,7 +42,7 @@ Filters are hooks that modify data. You can add a filter like this:
4242

4343
```php
4444
use SaschaEnde\Hookable\Facades\Hookable;
45-
Hookable::addFilter('my_filter', function ($value) {
45+
Hookable::filter('my_filter', function ($value) {
4646
// Modify $value
4747
return $value;
4848
});
@@ -59,7 +59,7 @@ $value = Hookable::applyFilters('my_filter', $value);
5959
You can specify the priority and number of arguments for your hooks.
6060

6161
```php
62-
Hookable::addAction('my_action', function ($arg1, $arg2) {
62+
Hookable::filter('my_action', function ($arg1, $arg2) {
6363
// Do something
6464
}, 20);
6565
```

0 commit comments

Comments
 (0)