Skip to content

Commit 7aceb91

Browse files
docs: Correct semi-colon for semicolon (without dash) (#464)
* docs: Correct semi-colon for semicolon (without dash) Semicolon is the correct spelling based on the Oxford Dictionary and dictionary.com
1 parent 6119828 commit 7aceb91

20 files changed

+34
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo
16511651
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
16521652
- Squiz.WhiteSpace.SuperfluousWhitespace no longer throws errors for spacing between functions and properties in anon classes
16531653
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
1654-
- Zend.Files.ClosingTag no longer adds a semi-colon during fixing of a file that only contains a comment
1654+
- Zend.Files.ClosingTag no longer adds a semicolon during fixing of a file that only contains a comment
16551655
- Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch
16561656
- Zend.NamingConventions.ValidVariableName now supports variables inside anonymous classes correctly
16571657
- 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
@@ -2260,7 +2260,7 @@ public function getTokensAsString($start, $length, $origContent=false)
22602260
* be returned.
22612261
* @param bool $local If true, tokens outside the current statement
22622262
* will not be checked. IE. checking will stop
2263-
* at the previous semi-colon found.
2263+
* at the previous semicolon found.
22642264
*
22652265
* @return int|false
22662266
* @see findNext()
@@ -2341,7 +2341,7 @@ public function findPrevious(
23412341
* be returned.
23422342
* @param bool $local If true, tokens outside the current statement
23432343
* will not be checked. i.e., checking will stop
2344-
* at the next semi-colon found.
2344+
* at the next semicolon found.
23452345
*
23462346
* @return int|false
23472347
* @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/CSS/SemicolonSpacingSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Ensure each style definition has a semi-colon and it is spaced correctly.
3+
* Ensure each style definition has a semicolon and it is spaced correctly.
44
*
55
* @author Greg Sherwood <[email protected]>
66
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
@@ -73,7 +73,7 @@ public function process(File $phpcsFile, $stackPtr)
7373
return;
7474
}
7575

76-
// There is a semi-colon, so now find the last token in the statement.
76+
// There is a semicolon, so now find the last token in the statement.
7777
$prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfThisStatement - 1), null, true);
7878
$found = $tokens[($endOfThisStatement - 1)]['length'];
7979
if ($tokens[$prevNonEmpty]['line'] !== $tokens[$endOfThisStatement]['line']) {

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

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

158158
if ($startCondition['code'] === T_MATCH) {
159-
// Move the stackPtr to after the semi-colon/comma if there is one.
159+
// Move the stackPtr to after the semicolon/comma if there is one.
160160
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
161161
if ($nextToken !== false
162162
&& ($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
@@ -59,7 +59,7 @@ public function process(File $phpcsFile, $stackPtr)
5959

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

62-
// Detect whether this is a semi-colon for a condition in a `for()` control structure.
62+
// Detect whether this is a semicolon for a condition in a `for()` control structure.
6363
$forCondition = false;
6464
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
6565
$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/ControlStructures/ForLoopDeclarationUnitTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ for (
117117
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0
118118
// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0
119119

120-
// Test with semi-colon not belonging to for.
120+
// Test with semicolon not belonging to for.
121121
for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {}
122122
for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);} ; i++) {}
123123

src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.js.fixed

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

86-
// Test with semi-colon not belonging to for.
86+
// Test with semicolon not belonging to for.
8787
for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {}
8888
for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);}; i++) {}
8989

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)