Skip to content

Commit f0ead32

Browse files
authored
[Documentation] PSR12 - Import Statement (#232)
* Add the documentation for the PSR12 Import Statement sniff
1 parent f6566e9 commit f0ead32

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<documentation title="Import Statement">
2+
<standard>
3+
<![CDATA[
4+
Import use statements must not begin with a leading backslash.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Import statement doesn't begin with a leading backslash.">
9+
<![CDATA[
10+
<?php
11+
12+
use Vendor\Package\ClassA as A;
13+
14+
class FooBar extends A
15+
{
16+
// Class content.
17+
}
18+
]]>
19+
</code>
20+
<code title="Invalid: Import statement begins with a leading backslash.">
21+
<![CDATA[
22+
<?php
23+
24+
use <em>\</em>Vendor\Package\ClassA as A;
25+
26+
class FooBar extends A
27+
{
28+
// Class content.
29+
}
30+
]]>
31+
</code>
32+
</code_comparison>
33+
</documentation>

0 commit comments

Comments
 (0)