Jesus heckin' christ PHP is awful
PHP-CS-Fixer 3.12.0 on my laptop gives different results to PHP-CS-Fixer 3.12.0 in github...
This commit is contained in:
parent
966c141848
commit
47ab0eda0a
5 changed files with 69 additions and 46 deletions
|
@ -521,16 +521,20 @@ function parse_shorthand_int(string $limit): int
|
|||
if (isset($m[2])) {
|
||||
switch (strtolower($m[2])) {
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case 't': $value *= 1024; // fall through
|
||||
case 't':
|
||||
$value *= 1024; // fall through
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
// no break
|
||||
case 'g': $value *= 1024; // fall through
|
||||
// no break
|
||||
case 'g':
|
||||
$value *= 1024; // fall through
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
// no break
|
||||
case 'm': $value *= 1024; // fall through
|
||||
// no break
|
||||
case 'k': $value *= 1024;
|
||||
break;
|
||||
// no break
|
||||
case 'm':
|
||||
$value *= 1024; // fall through
|
||||
// no break
|
||||
case 'k':
|
||||
$value *= 1024;
|
||||
break;
|
||||
default: $value = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,16 +171,21 @@ class CommentList extends Extension
|
|||
{
|
||||
if ($event->page_matches("comment")) {
|
||||
switch ($event->get_arg(0)) {
|
||||
case "add": $this->onPageRequest_add();
|
||||
break;
|
||||
case "delete": $this->onPageRequest_delete($event);
|
||||
break;
|
||||
case "bulk_delete": $this->onPageRequest_bulk_delete();
|
||||
break;
|
||||
case "list": $this->onPageRequest_list($event);
|
||||
break;
|
||||
case "beta-search": $this->onPageRequest_beta_search($event);
|
||||
break;
|
||||
case "add":
|
||||
$this->onPageRequest_add();
|
||||
break;
|
||||
case "delete":
|
||||
$this->onPageRequest_delete($event);
|
||||
break;
|
||||
case "bulk_delete":
|
||||
$this->onPageRequest_bulk_delete();
|
||||
break;
|
||||
case "list":
|
||||
$this->onPageRequest_list($event);
|
||||
break;
|
||||
case "beta-search":
|
||||
$this->onPageRequest_beta_search($event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,16 +162,21 @@ class MessageColumn extends Column
|
|||
{
|
||||
$c = "#000";
|
||||
switch ($row['priority']) {
|
||||
case SCORE_LOG_DEBUG: $c = "#999";
|
||||
break;
|
||||
case SCORE_LOG_INFO: $c = "#000";
|
||||
break;
|
||||
case SCORE_LOG_WARNING: $c = "#800";
|
||||
break;
|
||||
case SCORE_LOG_ERROR: $c = "#C00";
|
||||
break;
|
||||
case SCORE_LOG_CRITICAL: $c = "#F00";
|
||||
break;
|
||||
case SCORE_LOG_DEBUG:
|
||||
$c = "#999";
|
||||
break;
|
||||
case SCORE_LOG_INFO:
|
||||
$c = "#000";
|
||||
break;
|
||||
case SCORE_LOG_WARNING:
|
||||
$c = "#800";
|
||||
break;
|
||||
case SCORE_LOG_ERROR:
|
||||
$c = "#C00";
|
||||
break;
|
||||
case SCORE_LOG_CRITICAL:
|
||||
$c = "#F00";
|
||||
break;
|
||||
}
|
||||
return SPAN(["style"=>"color: $c"], rawHTML($this->scan_entities($row[$this->name])));
|
||||
}
|
||||
|
|
|
@ -151,16 +151,21 @@ class RotateImage extends Extension
|
|||
|
||||
/* Output to the same format as the original image */
|
||||
switch ($info[2]) {
|
||||
case IMAGETYPE_GIF: $result = imagegif($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_JPEG: $result = imagejpeg($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_PNG: $result = imagepng($image_rotated, $tmp_filename, 9);
|
||||
break;
|
||||
case IMAGETYPE_WEBP: $result = imagewebp($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_BMP: $result = imagebmp($image_rotated, $tmp_filename, true);
|
||||
break;
|
||||
case IMAGETYPE_GIF:
|
||||
$result = imagegif($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_JPEG:
|
||||
$result = imagejpeg($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_PNG:
|
||||
$result = imagepng($image_rotated, $tmp_filename, 9);
|
||||
break;
|
||||
case IMAGETYPE_WEBP:
|
||||
$result = imagewebp($image_rotated, $tmp_filename);
|
||||
break;
|
||||
case IMAGETYPE_BMP:
|
||||
$result = imagebmp($image_rotated, $tmp_filename, true);
|
||||
break;
|
||||
default:
|
||||
throw new ImageRotateException("Unsupported image type.");
|
||||
}
|
||||
|
|
|
@ -396,14 +396,18 @@ class Setup extends Extension
|
|||
$type = $_POST["_type_$name"];
|
||||
$value = isset($_POST["_config_$name"]) ? $_POST["_config_$name"] : null;
|
||||
switch ($type) {
|
||||
case "string": $config->set_string($name, $value);
|
||||
break;
|
||||
case "int": $config->set_int($name, parse_shorthand_int((string)$value));
|
||||
break;
|
||||
case "bool": $config->set_bool($name, bool_escape($value));
|
||||
break;
|
||||
case "array": $config->set_array($name, $value);
|
||||
break;
|
||||
case "string":
|
||||
$config->set_string($name, $value);
|
||||
break;
|
||||
case "int":
|
||||
$config->set_int($name, parse_shorthand_int((string)$value));
|
||||
break;
|
||||
case "bool":
|
||||
$config->set_bool($name, bool_escape($value));
|
||||
break;
|
||||
case "array":
|
||||
$config->set_array($name, $value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue