Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Jan 22, 2024
1 parent a22d0c6 commit 5e588b1
Showing 1 changed file with 17 additions and 67 deletions.
84 changes: 17 additions & 67 deletions src/Standards/PSR12/Docs/Files/FileHeaderStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,18 @@
]]>
</standard>
<code_comparison>
<code title="Valid: File header is the first content in the file.">
<code title="Valid: The file header is the first content in the file.">
<![CDATA[
<?php
/**
* This is a file comment.
*/
declare(strict_types=1);
namespace Vendor\Package;
use Vendor\Package\{ClassA as A, ClassB};
use const Another\Vendor\CONST_D;
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
// Remainder of the code in the file.
]]>
</code>
<code title="Invalid: File header is not the first content in the file.">
<code title="Invalid: The file header is not the first content in the file.">
<![CDATA[
<em><?php echo 'Some content'; ?></em>
<?php
Expand All @@ -40,26 +26,12 @@ class FooBar
* in the file.
*/
declare(strict_types=1);
namespace Vendor\Package;
use Vendor\Package\{ClassA as A, ClassB};
use const Another\Vendor\CONST_D;
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
// Remainder of the code in the file.
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: If header blocks are present, they are separated by a single blank line and don't contain blank lines.">
<code title="Valid: If the header blocks are present, they are separated by a single blank line and don't contain blank lines.">
<![CDATA[
<?php
Expand Down Expand Up @@ -87,16 +59,10 @@ use const Vendor\Package\{
};
use const Another\Vendor\CONST_D;
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
// Remainder of the code in the file.
]]>
</code>
<code title="Invalid: Header blocks are not separated by a single blank line, or contain blank lines between blocks.">
<code title="Invalid: The header blocks are not separated by a single blank line or contain blank lines between blocks.">
<![CDATA[
<?php
Expand All @@ -114,18 +80,12 @@ use function Vendor\Package\funcA;
<em></em>
use function Another\Vendor\funcD;
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
// Remainder of the code in the file.
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: If header blocks are present, they are ordered correctly as showed below.">
<code title="Valid: If the header blocks are present, they are ordered correctly as shown below.">
<![CDATA[
<?php
Expand Down Expand Up @@ -161,16 +121,9 @@ use const Vendor\Package\{
use const Another\Vendor\CONST_D;
// Remainder of the code in the file.
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
]]>
</code>
<code title="Invalid: Header blocks are not in a correct order.">
<code title="Invalid: The header blocks are not in the correct order.">
<![CDATA[
<?php
Expand All @@ -180,27 +133,24 @@ class FooBar
declare(strict_types=1);
namespace Vendor\Package;
use Vendor\Package\{ClassA as A, ClassB};
use Vendor\Package\SomeNamespace\ClassD as D;
// Namespace declaration
// after the class-based use import statements.
namespace Vendor\Package;
use Vendor\Package\AnotherNamespace\ClassE as E;
// Constant-based use imports statements
// before the function ones.
// before the function-based ones.
<em>use const Vendor\Package\{CONST_A, CONST_B};
use const Another\Vendor\CONST_D;</em>
use function Vendor\Package\{funcA, funcB};
use function Another\Vendor\funcD;
/**
* FooBar is an example class.
*/
class FooBar
{
// ... additional PHP code ...
}
// Remainder of the code in the file.
]]>
</code>
</code_comparison>
Expand Down

0 comments on commit 5e588b1

Please sign in to comment.