Skip to content

Commit 4cc3e59

Browse files
committed
File::getDeclarationName(): remove support for JS functions
Ref: * squizlabs/PHP_CodeSniffer 2448
1 parent 660de75 commit 4cc3e59

File tree

3 files changed

+0
-189
lines changed

3 files changed

+0
-189
lines changed

src/Files/File.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,6 @@ public function getDeclarationName($stackPtr)
12491249
throw new RuntimeException('Token type "'.$this->tokens[$stackPtr]['type'].'" is not T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM');
12501250
}
12511251

1252-
if ($tokenCode === T_FUNCTION
1253-
&& strtolower($this->tokens[$stackPtr]['content']) !== 'function'
1254-
) {
1255-
// This is a function declared without the "function" keyword.
1256-
// So this token is the function name.
1257-
return $this->tokens[$stackPtr]['content'];
1258-
}
1259-
12601252
$stopPoint = $this->numTokens;
12611253
if (isset($this->tokens[$stackPtr]['parenthesis_opener']) === true) {
12621254
// For functions, stop searching at the parenthesis opener.

tests/Core/File/GetDeclarationNameJSTest.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

tests/Core/File/GetDeclarationNameJSTest.php

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)