Skip to content

Documentation: minor consistency fixes #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 23, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: value to be asserted must go on the right side of the comparison.">
<code title="Valid: Value to be asserted must go on the right side of the comparison.">
<![CDATA[
if ($test === null) <em>{</em>
$var = 1;
<em>}</em>
]]>
</code>
<code title="Invalid: value to be asserted must not be on the left.">
<code title="Invalid: Value to be asserted must not be on the left.">
<![CDATA[
if (null === $test) <em>{</em>
$var = 1;
Expand Down
6 changes: 3 additions & 3 deletions src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<documentation title="Inline HTML">
<standard>
<![CDATA[
Files that contain php code should only have php code and should not have any "inline html".
Files that contain PHP code should only have PHP code and should not have any "inline html".
]]>
</standard>
<code_comparison>
<code title="Valid: A php file with only php code in it.">
<code title="Valid: A PHP file with only PHP code in it.">
<![CDATA[
<?php
$foo = 'bar';
echo $foo . 'baz';
]]>
</code>
<code title="Invalid: A php file with html in it outside of the php tags.">
<code title="Invalid: A PHP file with html in it outside of the PHP tags.">
<![CDATA[
<em>some string here</em>
<?php
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<documentation title="Aligning Blocks of Assignments">
<standard>
<![CDATA[
There should be one space on either side of an equals sign used to assign a value to a variable. In the case of a block of related assignments, more space may be inserted to promote readability.
There should be one space on either side of an equals sign used to assign a value to a variable. In the case of a block of related assignments, more space may be inserted to promote readability.
]]>
</standard>
<code_comparison>
<code title="Equals signs aligned">
<code title="Valid: Equals signs aligned.">
<![CDATA[
$shortVar <em>=</em> (1 + 2);
$veryLongVarName <em>=</em> 'string';
$var <em>=</em> foo($bar, $baz);
]]>
</code>
<code title="Not aligned; harder to read">
<code title="Invalid: Not aligned; harder to read.">
<![CDATA[
$shortVar <em>=</em> (1 + 2);
$veryLongVarName <em>=</em> 'string';
Expand All @@ -22,31 +22,31 @@ $var <em>=</em> foo($bar, $baz);
</code_comparison>
<standard>
<![CDATA[
When using plus-equals, minus-equals etc. still ensure the equals signs are aligned to one space after the longest variable name.
When using plus-equals, minus-equals etc. still ensure the equals signs are aligned to one space after the longest variable name.
]]>
</standard>
<code_comparison>
<code title="Equals signs aligned; only one space after longest var name">
<code title="Valid: Equals signs aligned; only one space after longest var name.">
<![CDATA[
$shortVar <em>+= </em>1;
$veryLongVarName<em> = </em>1;
]]>
</code>
<code title="Two spaces after longest var name">
<code title="Invalid: Two spaces after longest var name.">
<![CDATA[
$shortVar <em> += </em>1;
$veryLongVarName<em> = </em>1;
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Equals signs aligned">
<code title="Valid: Equals signs aligned.">
<![CDATA[
$shortVar <em> = </em>1;
$veryLongVarName<em> -= </em>1;
]]>
</code>
<code title="Equals signs not aligned">
<code title="Invalid: Equals signs not aligned.">
<![CDATA[
$shortVar <em> = </em>1;
$veryLongVarName<em> -= </em>1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
]]>
</standard>
<code_comparison>
<code title="Valid: brace on next line">
<code title="Valid: Brace on next line.">
<![CDATA[
function fooFunction($arg1, $arg2 = '')
<em>{</em>
...
}
]]>
</code>
<code title="Invalid: brace on same line">
<code title="Invalid: Brace on same line.">
<![CDATA[
function fooFunction($arg1, $arg2 = '') <em>{</em>
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: brace on same line">
<code title="Valid: Brace on same line.">
<![CDATA[
function fooFunction($arg1, $arg2 = '')<em> {</em>
...
}
]]>
</code>
<code title="Invalid: brace on next line">
<code title="Invalid: Brace on next line.">
<![CDATA[
function fooFunction($arg1, $arg2 = '')
<em>{</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: ">
<code title="Valid: Class name starts with 'Abstract'.">
<![CDATA[
abstract class <em>AbstractBar</em>
{
}
]]>
</code>
<code title="Invalid: ">
<code title="Invalid: Class name does not start with 'Abstract'.">
<![CDATA[
abstract class <em>Bar</em>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: ">
<code title="Valid: Interface name ends on 'Interface'.">
<![CDATA[
interface <em>BarInterface</em>
{
}
]]>
</code>
<code title="Invalid: ">
<code title="Invalid: Interface name does not end on 'Interface'.">
<![CDATA[
interface <em>Bar</em>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: ">
<code title="Valid: Trait name ends on 'Trait'.">
<![CDATA[
trait <em>BarTrait</em>
{
}
]]>
</code>
<code title="Invalid: ">
<code title="Invalid: Trait name does not end on 'Trait'.">
<![CDATA[
trait <em>Bar</em>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<documentation title="Constant Names">
<standard>
<![CDATA[
Constants should always be all-uppercase, with underscores to separate words.
Constants should always be all-uppercase, with underscores to separate words.
]]>
</standard>
<code_comparison>
<code title="Valid: all uppercase">
<code title="Valid: All uppercase constant name.">
<![CDATA[
define('<em>FOO_CONSTANT</em>', 'foo');

Expand All @@ -15,7 +15,7 @@ class FooClass
}
]]>
</code>
<code title="Invalid: mixed case">
<code title="Invalid: Mixed case or lowercase constant name.">
<![CDATA[
define('<em>Foo_Constant</em>', 'foo');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<documentation title="Opening Tag at Start of File">
<standard>
<![CDATA[
The opening php tag should be the first item in the file.
The opening PHP tag should be the first item in the file.
]]>
</standard>
<code_comparison>
<code title="Valid: A file starting with an opening php tag.">
<code title="Valid: A file starting with an opening PHP tag.">
<![CDATA[
<em></em><?php
echo 'Foo';
]]>
</code>
<code title="Invalid: A file with content before the opening php tag.">
<code title="Invalid: A file with content before the opening PHP tag.">
<![CDATA[
<em>Beginning content</em>
<?php
Expand Down
4 changes: 2 additions & 2 deletions src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<documentation title="Closing PHP Tags">
<standard>
<![CDATA[
All opening php tags should have a corresponding closing tag.
All opening PHP tags should have a corresponding closing tag.
]]>
</standard>
<code_comparison>
<code title="Valid: A closing tag paired with it's opening tag.">
<code title="Valid: A closing tag paired with its opening tag.">
<![CDATA[
<em><?php</em>
echo 'Foo';
Expand Down
4 changes: 2 additions & 2 deletions src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: lowercase constants">
<code title="Valid: Lowercase constants.">
<![CDATA[
if ($var === <em>false</em> || $var === <em>null</em>) {
$var = <em>true</em>;
}
]]>
</code>
<code title="Invalid: uppercase constants">
<code title="Invalid: Uppercase constants.">
<![CDATA[
if ($var === <em>FALSE</em> || $var === <em>NULL</em>) {
$var = <em>TRUE</em>;
Expand Down
8 changes: 4 additions & 4 deletions src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: strict_types declaration is present.">
<code title="Valid: `strict_types` declaration is present.">
<![CDATA[
declare(<em>strict_types=1</em>);

declare(encoding='UTF-8', <em>strict_types=0</em>);
]]>
</code>
<code title="Invalid: Missing strict_types declaration.">
<code title="Invalid: Missing `strict_types` declaration.">
<![CDATA[
declare(encoding='ISO-8859-1'<em></em>);
]]>
Expand All @@ -24,12 +24,12 @@ declare(encoding='ISO-8859-1'<em></em>);
]]>
</standard>
<code_comparison>
<code title="Valid: strict_types declaration is enabled.">
<code title="Valid: `strict_types` declaration is enabled.">
<![CDATA[
declare(strict_types=<em>1</em>);
]]>
</code>
<code title="Invalid: strict_types declaration is disabled.">
<code title="Invalid: `strict_types` declaration is disabled.">
<![CDATA[
declare(strict_types=<em>0</em>);
]]>
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (<em>PHP_SAPI</em> === 'cli') {
}
]]>
</code>
<code title="Invalid: php_sapi_name() is used.">
<code title="Invalid: Function call to php_sapi_name() is used.">
<![CDATA[
if (<em>php_sapi_name()</em> === 'cli') {
echo "Hello, CLI user.";
Expand Down
4 changes: 2 additions & 2 deletions src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
]]>
</standard>
<code_comparison>
<code title="Valid: uppercase constants">
<code title="Valid: Uppercase constants.">
<![CDATA[
if ($var === <em>FALSE</em> || $var === <em>NULL</em>) {
$var = <em>TRUE</em>;
}
]]>
</code>
<code title="Invalid: lowercase constants">
<code title="Invalid: Lowercase constants.">
<![CDATA[
if ($var === <em>false</em> || $var === <em>null</em>) {
$var = <em>true</em>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<documentation title="Subversion Properties">
<standard>
<![CDATA[
All php files in a subversion repository should have the svn:keywords property set to 'Author Id Revision' and the svn:eol-style property set to 'native'.
All PHP files in a subversion repository should have the svn:keywords property set to 'Author Id Revision' and the svn:eol-style property set to 'native'.
]]>
</standard>
</documentation>
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
]]>
</standard>
<code_comparison>
<code title="Valid: no spaces on the inside of a set of arbitrary parentheses.">
<code title="Valid: No spaces on the inside of a set of arbitrary parentheses.">
<![CDATA[
$a = (null !== $extra);
]]>
</code>
<code title="Invalid: spaces or new lines on the inside of a set of arbitrary parentheses.">
<code title="Invalid: Spaces or new lines on the inside of a set of arbitrary parentheses.">
<![CDATA[
$a = ( null !== $extra );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function foo(<em>&...$spread</em>) {
}
]]>
</code>
<code title="Invalid: space found between the spread operator and the variable/function call it applies to.">
<code title="Invalid: Space found between the spread operator and the variable/function call it applies to.">
<![CDATA[
function bar(<em>... </em>$spread) {
bar(<em>...
Expand Down
Loading