1
- <?php declare (strict_types=1 );
1
+ <?php
2
+
3
+ declare (strict_types=1 );
2
4
3
5
namespace TolerantASTConverter ;
4
6
@@ -60,15 +62,15 @@ public function __construct(string $file_contents, bool $include_offset = false,
60
62
/**
61
63
* Should this include the byte offset in the file where the node occurred?
62
64
*/
63
- public function setIncludeOffset (bool $ include_offset ) : void
65
+ public function setIncludeOffset (bool $ include_offset ): void
64
66
{
65
67
$ this ->include_offset = $ include_offset ;
66
68
}
67
69
68
70
/**
69
71
* Should this include the token kind (default is just the text of the token)
70
72
*/
71
- public function setIncludeTokenKind (bool $ include_token_kind ) : void
73
+ public function setIncludeTokenKind (bool $ include_token_kind ): void
72
74
{
73
75
$ this ->include_token_kind = $ include_token_kind ;
74
76
}
@@ -77,7 +79,7 @@ public function setIncludeTokenKind(bool $include_token_kind) : void
77
79
* Sets the text used for indentation (e.g. 4 spaces)
78
80
* @suppress PhanUnreferencedPublicMethod
79
81
*/
80
- public function setIndent (string $ indent ) : void
82
+ public function setIndent (string $ indent ): void
81
83
{
82
84
$ this ->indent = $ indent ;
83
85
}
@@ -86,7 +88,7 @@ public function setIndent(string $indent) : void
86
88
* Converts the class name of $ast_node to a short string describing that class name.
87
89
* Removes the common `Microsoft\\PhpParser\\` prefix
88
90
*/
89
- public static function dumpClassName (Node $ ast_node ) : string
91
+ public static function dumpClassName (Node $ ast_node ): string
90
92
{
91
93
$ name = get_class ($ ast_node );
92
94
if (\stripos ($ name , 'Microsoft \\PhpParser \\' ) === 0 ) {
@@ -100,7 +102,7 @@ public static function dumpClassName(Node $ast_node) : string
100
102
* Converts the class name of $token to a short string describing that class name.
101
103
* Removes the common `Microsoft\\PhpParser\\` prefix
102
104
*/
103
- public static function dumpTokenClassName (Token $ token ) : string
105
+ public static function dumpTokenClassName (Token $ token ): string
104
106
{
105
107
$ name = get_class ($ token );
106
108
if (\stripos ($ name , 'Microsoft \\PhpParser \\' ) === 0 ) {
@@ -115,7 +117,7 @@ public static function dumpTokenClassName(Token $token) : string
115
117
* @param string $padding (to be echoed before the current node
116
118
* @throws Exception for invalid $ast_node values
117
119
*/
118
- public function dumpTreeAsString ($ ast_node , string $ key = '' , string $ padding = '' ) : string
120
+ public function dumpTreeAsString ($ ast_node , string $ key = '' , string $ padding = '' ): string
119
121
{
120
122
if ($ ast_node instanceof Node) {
121
123
$ first_part = \sprintf (
@@ -156,7 +158,7 @@ public function dumpTreeAsString($ast_node, string $key = '', string $padding =
156
158
* @throws Exception for invalid $ast_node values
157
159
* @suppress PhanUnreferencedPublicMethod
158
160
*/
159
- public function dumpTree ($ ast_node , string $ key = '' , string $ padding = '' ) : void
161
+ public function dumpTree ($ ast_node , string $ key = '' , string $ padding = '' ): void
160
162
{
161
163
echo $ this ->dumpTreeAsString ($ ast_node , $ key , $ padding );
162
164
}
0 commit comments