-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Will probably need some fixup.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0"?> | ||
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd" | ||
title="Declare Statements Block Mode" | ||
> | ||
<standard> | ||
<![CDATA[ | ||
Defines the block mode usage of declare directives. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: Declare statement written in non-block mode."> | ||
<![CDATA[ | ||
declare(strict_types=1); | ||
declare(encoding='utf-8'); | ||
declare(ticks=10): | ||
// Code. | ||
enddeclare; | ||
]]> | ||
</code> | ||
<code title="Invalid: Declare statement written with curly braces or alternative syntax."> | ||
<![CDATA[ | ||
declare(encoding='ISO-8859-1', ticks=1) { | ||
// Code. | ||
} | ||
declare(encoding='ISO-8859-1', ticks=10): | ||
declare(encoding='utf-8'): | ||
// Code. | ||
enddeclare; | ||
enddeclare; | ||
]]> | ||
</code> | ||
</code_comparison> | ||
<standard> | ||
<![CDATA[ | ||
strict_types declaration directive mustn't be written using curly braces, or with alternative syntax. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: strict_types written without curly braces."> | ||
<![CDATA[ | ||
declare(strict_types=1); | ||
]]> | ||
</code> | ||
<code title="Invalid: strict_types written using alternative syntax/curly braces."> | ||
<![CDATA[ | ||
declare(strict_types=1, ticks=1) <em>{</em> | ||
// Code. | ||
<em>}</em> | ||
]]> | ||
</code> | ||
</code_comparison> | ||
</documentation> |