Skip to content
Snippets Groups Projects
Unverified Commit 0c6ba2c2 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

feat(MultiLineFunctionDeclaration): Enable multi-line function declaration checking (#3440075)

parent 24bad887
No related branches found
No related tags found
No related merge requests found
......@@ -255,23 +255,18 @@
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<!-- Disable some errors that are already coverd by other sniffs. -->
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace">
<severity>0</severity>
</rule>
<!-- Standard yet to be finalized on this (https://www.drupal.org/node/1539712). -->
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.Indent">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine">
<severity>0</severity>
</rule>
<rule ref="Squiz.PHP.LowercasePHPFunctions" />
<rule ref="Squiz.PHP.NonExecutableCode" />
......
......@@ -382,7 +382,8 @@ class BadUnitTest extends CoderSniffUnitTest
836 => 1,
838 => 1,
849 => 2,
855 => 2,
860 => 1,
864 => 2,
];
}//end switch
......
......@@ -852,4 +852,13 @@ class ScopeKeyword {
}
/**
* Multi-line function declaration brace should be on a new line.
*/
function test29(
int $a,
string $b) {
echo "Hello";
}
?>
\ No newline at end of file
......@@ -905,3 +905,13 @@ class ScopeKeyword {
}
}
/**
* Multi-line function declaration brace should be on a new line.
*/
function test29(
int $a,
string $b
) {
echo "Hello";
}
......@@ -1468,14 +1468,16 @@ function test17($arg) {
}
/**
* Ignore indentation of multi-line function declarations.
* Indentation of multi-line function declarations is standardized.
*/
function test18(ConfigFactoryInterface $config_factory,
EntityTypeManagerInterface $entity_type_manager,
CacheTagsInvalidatorInterface $cache_invalidator,
ModuleHandlerInterface $module_handler,
EntityFieldManagerInterface $entity_field_manager,
EntityTypeBundleInfoInterface $entity_type_bundle_info) {
function test18(
ConfigFactoryInterface $config_factory,
EntityTypeManagerInterface $entity_type_manager,
CacheTagsInvalidatorInterface $cache_invalidator,
ModuleHandlerInterface $module_handler,
EntityFieldManagerInterface $entity_field_manager,
EntityTypeBundleInfoInterface $entity_type_bundle_info
) {
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment