Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2012 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4269459 to your computer and use it in GitHub Desktop.
Save anonymous/4269459 to your computer and use it in GitHub Desktop.
phpcs PSR2 issue with "closure used directly in a function or method call as an argument"
> phpcs test.php --standard=PSR2
FILE: test.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
4 | ERROR | Opening parenthesis of a multi-line function call must be the
| | last content on the line
6 | ERROR | Closing parenthesis of a multi-line function call must be on a
| | line by itself
--------------------------------------------------------------------------------
<?php
$foo->bar(
$arg1,
function ($arg2) use ($var1) {
// body
},
$arg3
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment