Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) { |
||
49 | static $hooks_completed = array(); |
||
50 | |||
51 | $key = md5( serialize( func_get_args() ) ); |
||
52 | |||
53 | if ( in_array( $key, $hooks_completed ) ) { |
||
54 | return; |
||
55 | } |
||
56 | |||
57 | $hooks_completed[] = $key; |
||
58 | add_filter( $action, $hook, $priority, $accepted_args ); |
||
59 | } |
||
60 | |||
62 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.