Skip to content

Commit e39dae0

Browse files
dingo-djrfnl
andcommitted
Add the documentation for the PSR12 Import Statement sniff
Co-authored-by: Juliette <[email protected]>
1 parent 269098e commit e39dae0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 is fully qualified and 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+
use \FirstTrait;
17+
use SecondTrait;
18+
}
19+
]]>
20+
</code>
21+
<code title="Invalid: Import statement begins with a leading backslash.">
22+
<![CDATA[
23+
<?php
24+
25+
use <em>\</em>Vendor\Package\ClassA as A;
26+
27+
class FooBar extends A
28+
{
29+
use \FirstTrait;
30+
use SecondTrait;
31+
}
32+
]]>
33+
</code>
34+
</code_comparison>
35+
</documentation>

0 commit comments

Comments
 (0)