Skip to content

Commit 431bc8b

Browse files
DannyvdSluijsjrfnl
authored andcommitted
docs: Correct semi-colon for semicolon (without dash) (#464)
Semicolon is the correct spelling based on the Oxford Dictionary and dictionary.com
1 parent 584888e commit 431bc8b

17 files changed

+30
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo
17531753
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
17541754
- Squiz.WhiteSpace.SuperfluousWhitespace no longer throws errors for spacing between functions and properties in anon classes
17551755
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
1756-
- Zend.Files.ClosingTag no longer adds a semi-colon during fixing of a file that only contains a comment
1756+
- Zend.Files.ClosingTag no longer adds a semicolon during fixing of a file that only contains a comment
17571757
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
17581758
- Zend.NamingConventions.ValidVariableName now supports variables inside anonymous classes correctly
17591759
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch

src/Files/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ public function getTokensAsString($start, $length, $origContent=false)
21992199
* be returned.
22002200
* @param bool $local If true, tokens outside the current statement
22012201
* will not be checked. IE. checking will stop
2202-
* at the previous semi-colon found.
2202+
* at the previous semicolon found.
22032203
*
22042204
* @return int|false
22052205
* @see findNext()
@@ -2280,7 +2280,7 @@ public function findPrevious(
22802280
* be returned.
22812281
* @param bool $local If true, tokens outside the current statement
22822282
* will not be checked. i.e., checking will stop
2283-
* at the next semi-colon found.
2283+
* at the next semicolon found.
22842284
*
22852285
* @return int|false
22862286
* @see findPrevious()

src/Standards/Generic/Docs/CodeAnalysis/EmptyPHPStatementStandard.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
</code_comparison>
2121
<standard>
2222
<![CDATA[
23-
Superfluous semi-colons are not allowed.
23+
Superfluous semicolons are not allowed.
2424
]]>
2525
</standard>
2626
<code_comparison>
27-
<code title="Valid: There is no superfluous semi-colon after a PHP statement.">
27+
<code title="Valid: There is no superfluous semicolon after a PHP statement.">
2828
<![CDATA[
2929
function_call()<em>;</em>
3030
if (true) {
3131
echo 'Hello World'<em>;</em>
3232
}
3333
]]>
3434
</code>
35-
<code title="Invalid: There are one or more superfluous semi-colons after a PHP statement.">
35+
<code title="Invalid: There are one or more superfluous semicolons after a PHP statement.">
3636
<![CDATA[
3737
function_call()<em>;;;</em>
3838
if (true) {

src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Checks against empty PHP statements.
44
*
5-
* - Check against two semi-colons with no executable code in between.
5+
* - Check against two semicolons with no executable code in between.
66
* - Check against an empty PHP open - close tag combination.
77
*
88
* @author Juliette Reinders Folmer <[email protected]>
@@ -76,7 +76,7 @@ public function process(File $phpcsFile, $stackPtr)
7676
return;
7777
}
7878

79-
// Else, it's something like `if (foo) {};` and the semi-colon is not needed.
79+
// Else, it's something like `if (foo) {};` and the semicolon is not needed.
8080
}
8181

8282
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
@@ -91,7 +91,7 @@ public function process(File $phpcsFile, $stackPtr)
9191
}
9292

9393
$fix = $phpcsFile->addFixableWarning(
94-
'Empty PHP statement detected: superfluous semi-colon.',
94+
'Empty PHP statement detected: superfluous semicolon.',
9595
$stackPtr,
9696
'SemicolonWithoutCodeDetected'
9797
);
@@ -101,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr)
101101
if ($tokens[$prevNonEmpty]['code'] === T_OPEN_TAG
102102
|| $tokens[$prevNonEmpty]['code'] === T_OPEN_TAG_WITH_ECHO
103103
) {
104-
// Check for superfluous whitespace after the semi-colon which will be
104+
// Check for superfluous whitespace after the semicolon which will be
105105
// removed as the `<?php ` open tag token already contains whitespace,
106106
// either a space or a new line.
107107
if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) {

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Test empty statement: two consecutive semi-colons without executable code between them.
4+
* Test empty statement: two consecutive semicolons without executable code between them.
55
*/
66
function_call(); // OK.
77

@@ -50,10 +50,10 @@ function_call();
5050
<input name="<?= ; ?>" /> <!-- Bad. -->
5151

5252
<?php
53-
// Guard against false positives for two consecutive semi-colons in a for statement.
53+
// Guard against false positives for two consecutive semicolons in a for statement.
5454
for ( $i = 0; ; $i++ ) {}
5555

56-
// Test for useless semi-colons
56+
// Test for useless semicolons
5757
for ( $i = 0; ; $i++ ) {};
5858

5959
if (true) {};

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc.fixed

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Test empty statement: two consecutive semi-colons without executable code between them.
4+
* Test empty statement: two consecutive semicolons without executable code between them.
55
*/
66
function_call(); // OK.
77

@@ -45,10 +45,10 @@ function_call();
4545
<input name="" /> <!-- Bad. -->
4646

4747
<?php
48-
// Guard against false positives for two consecutive semi-colons in a for statement.
48+
// Guard against false positives for two consecutive semicolons in a for statement.
4949
for ( $i = 0; ; $i++ ) {}
5050

51-
// Test for useless semi-colons
51+
// Test for useless semicolons
5252
for ( $i = 0; ; $i++ ) {}
5353

5454
if (true) {}

src/Standards/PSR12/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<!-- checked by PSR12.Namespaces.CompoundNamespaceDepth -->
106106

107107
<!-- When wishing to declare strict types in files containing markup outside PHP opening and closing tags, the declaration MUST be on the first line of the file and include an opening PHP tag, the strict types declaration and closing tag. -->
108-
<!-- Declare statements MUST contain no spaces and MUST be exactly declare(strict_types=1) (with an optional semi-colon terminator). -->
108+
<!-- Declare statements MUST contain no spaces and MUST be exactly declare(strict_types=1) (with an optional semicolon terminator). -->
109109
<!-- Block declare statements are allowed and MUST be formatted as below. -->
110110
<!-- checked by PSR12.Files.DeclareStatement -->
111111

src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ public function process(File $phpcsFile, $stackPtr)
152152
}
153153
} while ($next !== false);
154154

155-
// Remove closing curly,semi-colon and any whitespace between last child and closing curly.
155+
// Remove closing curly, semicolon and any whitespace between last child and closing curly.
156156
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($closingCurly + 1), null, true);
157157
if ($next === false || $tokens[$next]['code'] !== T_SEMICOLON) {
158-
// Parse error, forgotten semi-colon.
158+
// Parse error, forgotten semicolon.
159159
$next = $closingCurly;
160160
}
161161

src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function process(File $phpcsFile, $stackPtr)
146146
}
147147

148148
if ($startCondition['code'] === T_MATCH) {
149-
// Move the stackPtr to after the semi-colon/comma if there is one.
149+
// Move the stackPtr to after the semicolon/comma if there is one.
150150
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
151151
if ($nextToken !== false
152152
&& ($tokens[$nextToken]['code'] === T_SEMICOLON

src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function process(File $phpcsFile, $stackPtr)
5151

5252
$end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_TAG], $stackPtr, null, false);
5353

54-
// If the token before the semi-colon is not a closing parenthesis, then we are not concerned.
54+
// If the token before the semicolon is not a closing parenthesis, then we are not concerned.
5555
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), null, true);
5656
if ($tokens[$prev]['code'] !== T_CLOSE_PARENTHESIS) {
5757
$phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no');

src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function process(File $phpcsFile, $stackPtr)
4949

5050
$nonSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 2), null, true);
5151

52-
// Detect whether this is a semi-colon for a condition in a `for()` control structure.
52+
// Detect whether this is a semicolon for a condition in a `for()` control structure.
5353
$forCondition = false;
5454
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
5555
$nestedParens = $tokens[$stackPtr]['nested_parenthesis'];

src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ for (
111111
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0
112112
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0
113113

114-
// Test with semi-colon not belonging to for.
114+
// Test with semicolon not belonging to for.
115115
for ($i = function() { return $this->i ; }; $i < function() { return $this->max; }; $i++) {}
116116
for ($i = function() { return $this->i; }; $i < function() { return $this->max; } ; $i++) {}
117117

src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ for ( $i = 0; $i < 10; $i++ ) {}
7777
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0
7878
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0
7979

80-
// Test with semi-colon not belonging to for.
80+
// Test with semicolon not belonging to for.
8181
for ($i = function() { return $this->i ; }; $i < function() { return $this->max; }; $i++) {}
8282
for ($i = function() { return $this->i; }; $i < function() { return $this->max; }; $i++) {}
8383

src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class MyOtherClass
7777
$varQ = 'string',
7878
$varR = 123;
7979

80-
// Intentionally missing a semi-colon for testing.
80+
// Intentionally missing a semicolon for testing.
8181
public
8282
$varS,
8383
$varT

src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class MyOtherClass
7272
$varQ = 'string',
7373
$varR = 123;
7474

75-
// Intentionally missing a semi-colon for testing.
75+
// Intentionally missing a semicolon for testing.
7676
public
7777
$varS,
7878
$varT

src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ $sum = $a /* + $b
1818
+ $c */ ;
1919

2020
/*
21-
* Test that the sniff does *not* throw incorrect errors for semi-colons in
21+
* Test that the sniff does *not* throw incorrect errors for semicolons in
2222
* "empty" parts of a `for` control structure.
2323
*/
2424
for ($i = 1; ; $i++) {}
2525
for ( ; $ptr >= 0; $ptr-- ) {}
2626
for ( ; ; ) {}
2727

28-
// But it should when the semi-colon in a `for` follows a comment (but shouldn't move the semi-colon).
28+
// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon).
2929
for ( /* Deliberately left empty. */ ; $ptr >= 0; $ptr-- ) {}
3030
for ( $i = 1 ; /* Deliberately left empty. */ ; $i++ ) {}
3131

src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ $sum = $a; /* + $b
1818
+ $c */
1919

2020
/*
21-
* Test that the sniff does *not* throw incorrect errors for semi-colons in
21+
* Test that the sniff does *not* throw incorrect errors for semicolons in
2222
* "empty" parts of a `for` control structure.
2323
*/
2424
for ($i = 1; ; $i++) {}
2525
for ( ; $ptr >= 0; $ptr-- ) {}
2626
for ( ; ; ) {}
2727

28-
// But it should when the semi-colon in a `for` follows a comment (but shouldn't move the semi-colon).
28+
// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon).
2929
for ( /* Deliberately left empty. */; $ptr >= 0; $ptr-- ) {}
3030
for ( $i = 1; /* Deliberately left empty. */; $i++ ) {}
3131

0 commit comments

Comments
 (0)