Skip to content

Commit b73e136

Browse files
rodrigoprimojrfnl
andcommitted
Committing code review suggestions
Co-authored-by: Juliette <[email protected]>
1 parent 9ea58ef commit b73e136

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop
113113

114114
$methodName = $phpcsFile->getDeclarationName($stackPtr);
115115
if ($methodName === null) {
116+
// Live coding or parse error. Bow out.
116117
return;
117118
}
118119

@@ -187,6 +188,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
187188
{
188189
$functionName = $phpcsFile->getDeclarationName($stackPtr);
189190
if ($functionName === null) {
191+
// Live coding or parse error. Bow out.
190192
return;
191193
}
192194

@@ -203,7 +205,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
203205
$phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData);
204206
}
205207

206-
// Ignore first underscore in functions prefixed with "_".
208+
// Ignore leading underscores in the method name.
207209
$functionName = ltrim($functionName, '_');
208210

209211
if (Common::isCamelCaps($functionName, false, true, $this->strict) === false) {

src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.1.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ enum Suit: string implements Colorful, CardGame {
185185
}
186186

187187
interface MyInterface {
188-
function getSomeValue(); // Ok.
189-
function get_some_value(); // Not ok.
188+
public function getSomeValue();
189+
public function get_some_value();
190190
}
191191

192192
class MyClass {

0 commit comments

Comments
 (0)