是否有一个代码嗅探器标准,可以在没有错误或警告的情况下运行下面的代码?如果没有,是否有创建代码标准的教程,这也解释了已实施标准的不同嗅探器?
<?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)
{
}
}
?>
感谢您的回答。