PHPC允许在一行中使用简单的方法
我找到密码了PHPC允许在一行中使用简单的方法,php,code-formatting,phpcodesniffer,Php,Code Formatting,Phpcodesniffer,我找到密码了 $ids = array_map(function ($entity) { return $entity->getId(); }, $entities); 可读性比 $ids = array_map(function ($entity) { return $entity->getId(); }, $entities); 但是,由于PSR-2样式的第一个样式失败,因此,该样式强制我使用第二个样式: Squiz.Functions.multilienfun
$ids = array_map(function ($entity) { return $entity->getId(); }, $entities);
可读性比
$ids = array_map(function ($entity) {
return $entity->getId();
}, $entities);
但是,由于PSR-2样式的第一个样式失败,因此,该样式强制我使用第二个样式:
指出,左大括号必须是行中的最后一个内容Squiz.Functions.multilienfunctiondeclaration.ContentAfterBrace
说右大括号必须单独在一行上Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore
说每个PHP语句必须单独在一行上Generic.Formatting.DisallowMultipleStatements.SameLine