forked from pronamic/wp-documentor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.php
33 lines (26 loc) · 887 Bytes
/
default.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Default Template
*
* @link https://github.com/themeblvd/hookster
* @author Pronamic <[email protected]>
* @copyright 2005-2022 Pronamic
* @license GPL-3.0-or-later
* @package DigitalJoeCo\Leantime\Documentor
*/
namespace DigitalJoeCo\Leantime\Documentor;
if ( ! isset( $documentor ) ) {
return;
}
$hooks = $documentor->get_hooks();
$pretty_printer = new \PhpParser\PrettyPrinter\Standard();
foreach ( $hooks as $hook ) {
echo $hook->get_file(), '#L', $hook->get_start_line(), '-', $hook->get_end_line(), PHP_EOL;
echo $pretty_printer->prettyPrintExpr( $hook->get_call() ), PHP_EOL;
echo $hook->get_tag()->get_name(), PHP_EOL;
echo $hook->get_summary(), PHP_EOL;
foreach ( $hook->get_arguments() as $argument ) {
echo ' - ', $argument->get_name(), ': ', $argument->get_type(), ': ', $argument->get_description(), PHP_EOL;
}
echo PHP_EOL;
}