Skip to content

Commit d06ea75

Browse files
authored
Merge pull request #81 from hc42/master
Bug Fix - fail to detect private functions with spaces after function…
2 parents 800e83b + 9f6e547 commit d06ea75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PHPCheckstyle/PHPCheckstyle.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ private function _processParenthesisClose($token) {
13461346
if ($this->statementStack->getCurrentStackItem()->openParentheses === 0) {
13471347

13481348
// We are in a array declaration, we unstack
1349-
if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_ARRAY AND
1349+
if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_ARRAY AND
13501350
$this->statementStack->getCurrentStackItem()->name !== 'square_bracket_open') {
13511351
$this->statementStack->pop();
13521352
}
@@ -2228,7 +2228,7 @@ private function _processFunctionStatement() {
22282228
if ($currentToken->id === T_STRING) {
22292229
$nameDetected = $currentToken->text;
22302230
}
2231-
$curlyOpeningDetected = $this->tokenizer->checkNextToken(T_PARENTHESIS_OPEN);
2231+
$curlyOpeningDetected = $this->tokenizer->checkNextValidToken(T_PARENTHESIS_OPEN);
22322232
}
22332233

22342234
// currentToken should end up being the function name token
@@ -2582,8 +2582,8 @@ private function _checkEmptyBlock() {
25822582
* This function is launched when the current token is T_ENCAPSED_AND_WHITESPACE.
25832583
*/
25842584
private function _checkEncapsedVariablesInsideString() {
2585-
if ($this->_isActive('encapsedVariablesInsideString') AND !$this->statementStack->getCurrentStackItem()->inHeredoc
2586-
OR ($this->_inFuncCall AND !$this->_config->isException('encapsedVariablesInsideString', end($this->_currentFuncCall)))) {
2585+
if ($this->_isActive('encapsedVariablesInsideString') AND (!$this->statementStack->getCurrentStackItem()->inHeredoc
2586+
OR ($this->_inFuncCall AND !$this->_config->isException('encapsedVariablesInsideString', end($this->_currentFuncCall))))) {
25872587
$this->_writeError('encapsedVariablesInsideString', $this->_getMessage('VARIABLE_INSIDE_STRING'));
25882588
}
25892589
}

0 commit comments

Comments
 (0)