Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index errors #352

Closed
alexbilbie opened this issue Dec 9, 2014 · 3 comments
Closed

Undefined index errors #352

alexbilbie opened this issue Dec 9, 2014 · 3 comments

Comments

@alexbilbie
Copy link

Running the command

/usr/bin/hhvm vendor/bin/phpcs --standard=PSR2 --extensions=php --report=checkstyle --report-file=build/logs/checkstyle.xml App/

I get the following errors:

Notice: Undefined index:  in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php on line 112

Notice: Undefined index:  in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php on line 113

Notice: Undefined index:  in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php on line 113

Notice: Undefined index: -1 in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php on line 359

Notice: Undefined index:  in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php on line 134

Notice: Undefined index:  in /var/lib/jenkins/workspace/app-api-rewrite/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php on line 134
Time: 2.81 secs; Memory: 48.53Mb

I'm using "squizlabs/php_codesniffer": "~2.0" in my composer.json file.

I'm running on Ubuntu 14.04 with HHVM 3.4.0

@gsherwood
Copy link
Member

I'm not going to be able to replicate and fix these errors unless you're able to provide some code that I can use to replicate it. Is that possible in this case?

Also note that running PHPCS with the -v flag will print the name of each file while processing, letting you see which file is causing the error, which could help with providing some code.

All I can gather from the error messages is that there is an opening parentheses without a matching closing parentheses, which means that the tokenizer has failed to match it for some reason, or you've got a parse error.

@alexbilbie
Copy link
Author

Using the -v flag I found a syntax error in a file. Thanks

@gsherwood
Copy link
Member

Thanks for getting back to me.

jrfnl pushed a commit to jrfnl/PHP_CodeSniffer that referenced this issue Jul 29, 2024
* Docs: add documentation for Squiz.WhiteSpace.SuperfluousWhitespace

* Docs: improve documentation for Squiz.WhiteSpace.SuperfluousWhitespace

- Add code comparison for a missed error code (EOF)
- Fixup CDATA indentation
- Clarify wording in code examples

* Docs: fix typo in Squiz.WhiteSpace.SuperfluousWhitespace code example

* Docs: rewrite incorrect code example for Squiz.WhiteSpace.SuperfluousWhitespace.EndFile

* Squiz/SuperfluousWhitespace: tiny tweak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants