PhpStorm 检查声称在第二种情况下中断后的所有内容都无法访问。我不明白为什么。我错过了什么?
function mymodule_admin_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'taxonomy_overview_terms':
// We need to add a submit handler to this form so we can save the weight
// in Mongo.
$form['#submit'][] = 'mymodule_admin_taxonomy_overview_submit_mongo';
break;
// Unwraps the mymodule News node form
case 'mymodule_news_node_form':
$form['#nowrap'] = true;
$form['field_news_image']['#prefix'] = '<div class="row"><div class="large-5 columns">';
$form['field_news_image']['#suffix'] = '</div></div>';
$form['actions']['#prefix'] = '<div class="row"><div class="large-3 columns actions">';
$form['actions']['#suffix'] = '</div></div>';
break; // PhpStorm claims everything after this is unreachable ******
// Unwraps the page forms
case 'basic_page_with_multiple_images_node_form':
$form['#nowrap'] = true;
$form['field_bottom_image']['#prefix'] = '<div class="row"><div class="large-5 columns">';
$form['field_bottom_image']['#suffix'] = '</div></div>';
$form['actions']['#prefix'] = '<div class="row"><div class="large-3 columns actions">';
$form['actions']['#suffix'] = '</div></div>';
break;
case 'page_node_form':
$form['#nowrap'] = true;
$form['field_bottom_image']['#prefix'] = '<div class="row"><div class="large-5 columns">';
$form['field_bottom_image']['#suffix'] = '</div></div>';
$form['actions']['#prefix'] = '<div class="row"><div class="large-3 columns actions">';
$form['actions']['#suffix'] = '</div></div>';
break;
case 'basic_page_with_top_image':
$form['#nowrap'] = true;
$form['field_top_image']['#prefix'] = '<div class="row"><div class="large-5 columns">';
$form['field_top_image']['#suffix'] = '</div></div>';
$form['actions']['#prefix'] = '<div class="row"><div class="large-3 columns actions">';
$form['actions']['#suffix'] = '</div></div>';
break;
case 'basic_page_with_inline_images_node_form':
$form['#nowrap'] = true;
$form['actions']['#prefix'] = '<div class="row"><div class="large-3 columns actions">';
$form['actions']['#suffix'] = '</div></div>';
break;
}
}
我没有包含其余代码,因为 stackoverflow 告诉我我的问题有太多代码。
如您所见,在相关案例之后还有更多条件。如果前两个条件不满足,则应评估其余条件,因此其余代码是可访问的。这不正确吗?