From eb91bc14182dc3a2c21a066145bd07f929808690 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Wed, 24 Aug 2022 13:02:36 +0300 Subject: [PATCH] Make sure to check all method parameters When checking whether method parameters are camelcased, the `CamelCaseMethodParameterSniff` currently will stop processing as soon as it finds a valid parameter. It should check the remaining parameters as well. --- .../Sniffs/NamingConventions/CamelCaseMethodParameterSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coding_standards/LiipDrupalPractice/Sniffs/NamingConventions/CamelCaseMethodParameterSniff.php b/coding_standards/LiipDrupalPractice/Sniffs/NamingConventions/CamelCaseMethodParameterSniff.php index 34fad41..ac9d82c 100644 --- a/coding_standards/LiipDrupalPractice/Sniffs/NamingConventions/CamelCaseMethodParameterSniff.php +++ b/coding_standards/LiipDrupalPractice/Sniffs/NamingConventions/CamelCaseMethodParameterSniff.php @@ -50,7 +50,7 @@ protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScop $methodName = ltrim($methodParam['name'],"$"); if (preg_match('/^[a-z]/', $methodName) === 1 && strpos($methodName, '_') === false) { - return; + continue; } $warning = 'Method parameter should user lowerCamel naming without underscores: %s';