Is there a standard for codesniffer which would run without an error or warning for the code below? If no is there a tutorial for creating a code standard, that also explains the different sniffers of the already implemented standards?
<?php
/**
* project name
*
* description
*
* @author First Last <email@google.com>
*/
class Cookie
{
public static function set($key, $user, $timeout, $data, $sessionId)
{
foreach($user as $key => $value)
{
// some other things
}
if($key > 1)
{
// Line length 120
// Unix line endings
// no counts in loops
}
elseif($key == 1)
{
$timeout = TRUE;
}
switch ($data)
{
case '1':
{
// only '' for strings
}break;
case '2':
{
}break;
default:
{
}break;
}
}
public static function get($key)
{
}
public static function delete($key)
{
}
}
?>
Thanks for your answers.