FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16778&edit=1

ID: 16778
Updated by: typo3-community@gmx.de
Reported By: typo3-community at gmx dot de
Summary: PHPCS can not deside how many spaces it wants (Zend
Coding Standard)
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows XP
Package Version: 1.2.0
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

...wants 8 spaces for the first "}" (in line 36)...


Previous Comments:
------------------------------------------------------------------------

[2009-11-10 09:46:31] daniela_waranie

Description:
------------
When validating the code (see test script) against the zend coding
standard, PHP CodeSniffer wants 8 spaces for the "}", after changing
from 12 to 8 it wants 12 spaces (loop).



Test script:
---------------
function isRelevantForAnalysis ($question)
{

switch ( $question['type'] ) {

//List
case 'L':
return true;
break;

//Yes/No
case 'Y':
return true;
break;

//Multiselect
case 'M':
return true;
break;

//Matix Field
case 'F':
return true;
break;

//Gender
case 'G':
return true;
break;

default:
//Date 'D'
//Short Text 'S'
return false;
break;
}
}

Expected result:
----------------
It works (8 spaces) when the "default:" block has a "break;". But note
"break;" is NOT mandatory. It should work without it!

------------------------------------------------------------------------

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 10, '09 at 8:56a
activeNov 10, '09 at 8:56a
posts2
users2
websitepear.php.net

2 users in discussion

Typo3-community: 1 post Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase