File tree 2 files changed +120
-5
lines changed
tests/php-ts-mode-resources
2 files changed +120
-5
lines changed Original file line number Diff line number Diff line change @@ -49,3 +49,95 @@ class Ba|sic {}
49
49
=-=
50
50
php-class
51
51
=-=-=
52
+
53
+ Name: Class base clause
54
+ No-After-Newline: t
55
+
56
+ =-=
57
+ <?php
58
+ class Basic extends Par|ent{}
59
+ =-=
60
+ php-class
61
+ =-=-=
62
+
63
+ Name: This sigil
64
+ No-After-Newline: t
65
+
66
+ =-=
67
+ <?php
68
+ |$this
69
+ =-=
70
+ php-this-sigil
71
+ =-=-=
72
+
73
+ Name: This
74
+ No-After-Newline: t
75
+
76
+ =-=
77
+ <?php
78
+ $t|his
79
+ =-=
80
+ php-this
81
+ =-=-=
82
+
83
+ Name: Optional type
84
+ No-After-Newline: t
85
+
86
+ =-=
87
+ <?php
88
+ function test(|?int $arg) {}
89
+ =-=
90
+ php-type
91
+ =-=-=
92
+
93
+ Name: Scoped propery access
94
+ No-After-Newline: t
95
+
96
+ =-=
97
+ <?php
98
+ |Test::$test;
99
+ =-=
100
+ php-class
101
+ =-=-=
102
+
103
+ Name: Class constant access with qualified name
104
+ No-After-Newline: t
105
+
106
+ =-=
107
+ <?php
108
+ |\Test::TEST;
109
+ =-=
110
+ php-class
111
+ =-=-=
112
+
113
+ Name: Trait use declation
114
+ No-After-Newline: t
115
+
116
+ =-=
117
+ <?php
118
+ class Test {
119
+ use Te|st;
120
+ }
121
+ =-=
122
+ php-class
123
+ =-=-=
124
+
125
+ Name: Built-in function
126
+ No-After-Newline: t
127
+
128
+ =-=
129
+ <?php
130
+ iss|et($t)
131
+ =-=
132
+ php-keyword
133
+ =-=-=
134
+
135
+ Name: Object create expression with qualified name
136
+ No-After-Newline: t
137
+
138
+ =-=
139
+ <?php
140
+ $t = new |\Test();
141
+ =-=
142
+ php-class
143
+ =-=-=
Original file line number Diff line number Diff line change 2
2
(lambda ()
3
3
(setq indent-tabs-mode nil)
4
4
(setq php-ts-mode-indent-offset 4)
5
+ (setq tab-width 4)
5
6
(php-ts-mode)
6
7
(indent-region (point-min) (point-max)))
7
8
@@ -97,6 +98,16 @@ Name: Opening bracket on new line
97
98
=-=
98
99
<?php
99
100
101
+ class Test
102
+ {
103
+ public function test(): void
104
+ {
105
+ return;
106
+ }
107
+ }
108
+ =-=
109
+ <?php
110
+
100
111
class Test
101
112
{
102
113
public function test(): void
@@ -106,18 +117,30 @@ class Test
106
117
}
107
118
=-=-=
108
119
109
- Name: Switch
120
+ Name: Switch default statement
110
121
111
122
=-=
112
123
<?php
113
124
114
- public function test()
125
+ function test()
126
+ {
127
+ switch ($cond) {
128
+ case 1:
129
+ return 1;
130
+ default:
131
+ return 2;
132
+ }
133
+ }
134
+ =-=
135
+ <?php
136
+
137
+ function test()
115
138
{
116
139
switch ($cond) {
117
140
case 1:
118
- return 1;
119
- default:
120
- return 2;
141
+ return 1;
142
+ default:
143
+ return 2;
121
144
}
122
145
}
123
146
=-=-=
You can’t perform that action at this time.
0 commit comments