File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
src/Standards/PSR12/Docs/Files Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ <documentation title =" Import Statement" >
2
+ <standard >
3
+ <![CDATA[
4
+ Import statements must not begin with a leading backslash.
5
+ ]]>
6
+ </standard >
7
+ <code_comparison >
8
+ <code title =" Valid: Import statements are fully qualified and don't begin a leading backslash." >
9
+ <![CDATA[
10
+ <?php
11
+
12
+ /**
13
+ * This is a file comment.
14
+ */
15
+
16
+ declare(strict_types=1);
17
+
18
+ namespace Vendor\Package;
19
+
20
+ use Vendor\Package\{ClassA as A, ClassB};
21
+
22
+ /**
23
+ * FooBar is an example class.
24
+ */
25
+ class FooBar
26
+ {
27
+ // ... additional PHP code ...
28
+ }
29
+ ]]>
30
+ </code >
31
+ <code title =" Invalid: Import statements begin with a leading backslash." >
32
+ <![CDATA[
33
+ <?php
34
+
35
+ /**
36
+ * This is a file comment.
37
+ */
38
+
39
+ declare(strict_types=1);
40
+
41
+ namespace Vendor\Package;
42
+
43
+ use <em>\</em>Vendor\Package\{ClassA as A, ClassB};
44
+
45
+ /**
46
+ * FooBar is an example class.
47
+ */
48
+ class FooBar
49
+ {
50
+ // ... additional PHP code ...
51
+ }
52
+ ]]>
53
+ </code >
54
+ </code_comparison >
55
+ </documentation >
You can’t perform that action at this time.
0 commit comments