[development] comment module: minor issue unreachable code

Hans Wolters hans at lonki.xs4all.nl
Tue Aug 21 21:20:41 UTC 2007


Hi,

On 21-aug-2007, at 22:00, Gerhard Killesreiter wrote:


>>>> In the comment module there is some code that will never be  
>>>> reached:
>>>>
>>>
>>> Hi Hans, the proper place to mention this would be in Drupal's issue
>>> queue. You can submit a bug report here:
>>> http://drupal.org/node/add/project_issue/drupal/bug
>>>
>> No content types available.
>>
>> Or is this only for user nobody?
>>
>
> Yes.
>
> Also, putting a break even if it can't be reached is IMO good  
> coding style.
>
>

I.m.h.o it would then need a rewrite to make sure the switch would  
return it after it
is finished.

switch($foo) {

	case ('bar'):
		$result = 1;
		break;
	case ('otherbar');
		$result = 2;
		break;
	default:
		$result = 3;
}

return $result; // or whatever needs to be done with it.

But then again, it's only my opinion.

Regards,

Hans


More information about the development mailing list