diff --git a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc index 2d528d3..f2a494b 100644 --- a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc +++ b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc @@ -191,15 +191,14 @@ function test16() { /** * Void returns allowed when null is given in @return. * - * When null is a potential return value it should be alright to have return - * statements with void return. + * When null is a potential return value it should be allowed to have return + * statements with void return as well. * * @return bool|null - * It should be alright to have a void return in the function. + * This implies that the return value can be NULL, a boolean, or empty. */ function test17() { if (1 == 2) { - // This should be alright. return; } return TRUE; @@ -208,18 +207,16 @@ function test17() { /** * Even when null is given in @return there must be at least 1 valid return. * - * When null is a potential return value it should be alright to have return - * statements with void return but this does not mean that all returns can - * be void. There must be at least one non-void return. + * When null is a potential return value it should be allowed to have return + * statements with void return. This does not mean that all returns can be void. + * There must be at least one non-void return. * * @return bool|null - * It should be alright to have a void return in the function. + * This implies that the return value can be NULL, a boolean, or empty. */ function test18() { if (1 == 2) { - // This should be alright. return; } - // All the returns in the functions return void, that can't be. return; } diff --git a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed index 30e81ae..dd64366 100644 --- a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed +++ b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed @@ -202,15 +202,14 @@ function test16() { /** * Void returns allowed when null is given in @return. * - * When null is a potential return value it should be alright to have return - * statements with void return. + * When null is a potential return value it should be allowed to have return + * statements with void return as well. * * @return bool|null - * It should be alright to have a void return in the function. + * This implies that the return value can be NULL, a boolean, or empty. */ function test17() { if (1 == 2) { - // This should be alright. return; } return TRUE; @@ -219,18 +218,16 @@ function test17() { /** * Even when null is given in @return there must be at least 1 valid return. * - * When null is a potential return value it should be alright to have return - * statements with void return but this does not mean that all returns can - * be void. There must be at least one non-void return. + * When null is a potential return value it should be allowed to have return + * statements with void return. This does not mean that all returns can be void. + * There must be at least one non-void return. * * @return bool|null - * It should be alright to have a void return in the function. + * This implies that the return value can be NULL, a boolean, or empty. */ function test18() { if (1 == 2) { - // This should be alright. return; } - // All the returns in the functions return void, that can't be. return; } diff --git a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php index 4e874ff..05045ec 100644 --- a/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php +++ b/coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php @@ -31,7 +31,7 @@ class Drupal_Sniffs_Commenting_FunctionCommentUnitTest extends CoderSniffUnitTes 148 => 3, 180 => 1, 187 => 1, - 215 => 1, + 214 => 1, ); }//end getErrorList()