-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
71 lines (68 loc) · 2.12 KB
/
bootstrap.php
File metadata and controls
71 lines (68 loc) · 2.12 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @see https://kint-php.github.io/kint/settings/ Kint configuration
*/
Kint\Kint::$display_called_from = false;
Kint\Kint::$return = false;
Kint\Kint::$cli_detection = false;
Kint\Kint::$depth_limit = 10;
Kint\Kint::$file_link_format = 'phpstorm://open?url=file://%f&line=%l';
Kint\Parser\ArrayLimitPlugin::$trigger = 500;
Kint\Parser\ArrayLimitPlugin::$limit = 250;
Kint\Renderer\RichRenderer::$strlen_max = 1024;
/**
* Reflection helpers.
*/
if (!function_exists('rc')) {
/**
* @param string|object $class
* @return string
* @throws ReflectionException
*/
function rc($class)
{
// gets brief description of given class/interface
$result = preg_replace(
['/\s+?- [\w\h]+ \[0\] \{\s+?\}/', '/@@ [^\s]+ \d+\s?-\s?\d+\s*/'],
'',
(string) new ReflectionClass($class)
);
$result = htmlspecialchars($result, ENT_HTML5 | ENT_NOQUOTES);
echo '<pre class="reflection fs-6 py-1">' . $result . '</pre>';
}
}
if (!function_exists('rm')) {
/**
* @param string|object $classOrObject
* @param string $method the method name
* @return string
*/
function rm($class, string $method)
{
// gets brief description of given method
$str = preg_replace(
['/\s+?- [\w\h]+ \[0\] \{\s+?\}/', '/@@ [^\s]+ \d+\s?-\s?\d+\s*/'],
'',
(string) (new ReflectionClass($class))->getMethod($method)
);
$str = htmlspecialchars($str, ENT_HTML5 | ENT_NOQUOTES);
echo '<pre class="reflection fs-6 py-1">' . $str . '</pre>';
}
}
if (!function_exists('rf')) {
/**
* @param string $function the function name
* @return string
*/
function rf(string $function)
{
// gets brief description of given function
$str = preg_replace(
['/\s+?- [\w\h]+ \[0\] \{\s+?\}/', '/@@ [^\s]+ \d+\s?-\s?\d+\s*/'],
'',
(string) new ReflectionFunction($function)
);
$str = htmlspecialchars($str, ENT_HTML5 | ENT_NOQUOTES);
echo '<pre class="reflection fs-6 py-1">' . $str . '</pre>';
}
}