File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 3
3
namespace WP_Parser ;
4
4
5
5
use phpDocumentor \Reflection \BaseReflector ;
6
+ use PhpParser \Node ;
6
7
use PHPParser_PrettyPrinter_Default ;
7
8
8
9
/**
@@ -29,16 +30,13 @@ class Hook_Reflector extends BaseReflector {
29
30
* from: do_action( $filter_name, $args );
30
31
* name: {$filter_name}
31
32
*
32
- * @param ?\PhpParser\ Node $node Use this instead of the current node.
33
- * @return string
33
+ * @param ?Node $node Which node to examine; defaults to the parser's current node.
34
+ * @return string Represents the hook's name, including any interpolations into the hook name.
34
35
*/
35
36
public function getName ( $ node = null ) {
36
- /**
37
- * The current Node being examined.
38
- *
39
- * @var \PhpParser\Node
40
- */
41
- $ node = $ node ?? $ this ->node ->args [0 ]->value ;
37
+ if ( null === $ node ) {
38
+ $ node = $ this ->node ->args [0 ]->value ;
39
+ }
42
40
$ printer = new PHPParser_PrettyPrinter_Default ;
43
41
$ name = $ printer ->prettyPrintExpr ( $ node );
44
42
You can’t perform that action at this time.
0 commit comments