fixed code sniffer reported errors
This commit is contained in:
@ -47,20 +47,20 @@ class Date extends Base {
|
|||||||
$year = (isset($value[0]) ? (int)$value[0] : null);
|
$year = (isset($value[0]) ? (int)$value[0] : null);
|
||||||
$month = (isset($value[1]) ? (int)$value[1] : null);
|
$month = (isset($value[1]) ? (int)$value[1] : null);
|
||||||
$day = (isset($value[2]) ? (int)$value[2] : null);
|
$day = (isset($value[2]) ? (int)$value[2] : null);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year_month':
|
case 'year_month':
|
||||||
$year = (isset($value[0]) ? (int)$value[0] : null);
|
$year = (isset($value[0]) ? (int)$value[0] : null);
|
||||||
$month = (isset($value[1]) ? (int)$value[1] : null);
|
$month = (isset($value[1]) ? (int)$value[1] : null);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'month':
|
case 'month':
|
||||||
$month = (isset($value[0]) ? (int)$value[0] : null);
|
$month = (isset($value[0]) ? (int)$value[0] : null);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
$year = (isset($value[0]) ? (int)$value[0] : null);
|
$year = (isset($value[0]) ? (int)$value[0] : null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class CustomField extends Model {
|
|||||||
$value['month'],
|
$value['month'],
|
||||||
$value['day']
|
$value['day']
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year_month':
|
case 'year_month':
|
||||||
$value = sprintf(
|
$value = sprintf(
|
||||||
@ -66,7 +66,7 @@ class CustomField extends Model {
|
|||||||
$value['year'],
|
$value['year'],
|
||||||
$value['month']
|
$value['month']
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'month':
|
case 'month':
|
||||||
if((int)$value['month'] === 0) {
|
if((int)$value['month'] === 0) {
|
||||||
@ -77,7 +77,7 @@ class CustomField extends Model {
|
|||||||
$value['month']
|
$value['month']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
if((int)$value['year'] === 0) {
|
if((int)$value['year'] === 0) {
|
||||||
@ -88,7 +88,7 @@ class CustomField extends Model {
|
|||||||
$value['year']
|
$value['year']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,9 +225,9 @@ class Pages {
|
|||||||
|
|
||||||
if($custom_field['type'] === 'date') {
|
if($custom_field['type'] === 'date') {
|
||||||
$date_formats = FormBlockDate::getDateFormats();
|
$date_formats = FormBlockDate::getDateFormats();
|
||||||
$custom_field['params']['date_format'] = $date_formats[
|
$custom_field['params']['date_format'] = array_shift(
|
||||||
$custom_field['params']['date_type']
|
$date_formats[$custom_field['params']['date_type']]
|
||||||
][0];
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $custom_field;
|
return $custom_field;
|
||||||
|
Reference in New Issue
Block a user