php - PHPCS Allow simple methods in one line -
i find code
$ids = array_map(function ($entity) { return $entity->getid(); }, $entities);
much more readable than
$ids = array_map(function ($entity) { return $entity->getid(); }, $entities);
however, phpcs forces me use second style, because first 1 fails following psr-2 styles:
squiz.functions.multilinefunctiondeclaration.contentafterbrace
says opening brace must last content on linesquiz.whitespace.scopeclosingbrace.contentbefore
says closing brace must on line itselfgeneric.formatting.disallowmultiplestatements.sameline
says each php statement must on line itself
while agree these checks in other places, in case wrong.
is there rule phpcs should allow simple methods in 1 line phpstorm does?
i know can ignore phpcs checks in such places prefer tackling in global configuration.
Comments
Post a Comment