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:
Shish 2022-10-27 17:29:24 +01:00
parent 966c141848
commit 47ab0eda0a
5 changed files with 69 additions and 46 deletions

View file

@ -521,15 +521,19 @@ function parse_shorthand_int(string $limit): int
if (isset($m[2])) { if (isset($m[2])) {
switch (strtolower($m[2])) { switch (strtolower($m[2])) {
/** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */
case 't': $value *= 1024; // fall through case 't':
$value *= 1024; // fall through
/** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */
// no break // no break
case 'g': $value *= 1024; // fall through case 'g':
$value *= 1024; // fall through
/** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */
// no break // no break
case 'm': $value *= 1024; // fall through case 'm':
$value *= 1024; // fall through
// no break // no break
case 'k': $value *= 1024; case 'k':
$value *= 1024;
break; break;
default: $value = -1; default: $value = -1;
} }

View file

@ -171,15 +171,20 @@ class CommentList extends Extension
{ {
if ($event->page_matches("comment")) { if ($event->page_matches("comment")) {
switch ($event->get_arg(0)) { switch ($event->get_arg(0)) {
case "add": $this->onPageRequest_add(); case "add":
$this->onPageRequest_add();
break; break;
case "delete": $this->onPageRequest_delete($event); case "delete":
$this->onPageRequest_delete($event);
break; break;
case "bulk_delete": $this->onPageRequest_bulk_delete(); case "bulk_delete":
$this->onPageRequest_bulk_delete();
break; break;
case "list": $this->onPageRequest_list($event); case "list":
$this->onPageRequest_list($event);
break; break;
case "beta-search": $this->onPageRequest_beta_search($event); case "beta-search":
$this->onPageRequest_beta_search($event);
break; break;
} }
} }

View file

@ -162,15 +162,20 @@ class MessageColumn extends Column
{ {
$c = "#000"; $c = "#000";
switch ($row['priority']) { switch ($row['priority']) {
case SCORE_LOG_DEBUG: $c = "#999"; case SCORE_LOG_DEBUG:
$c = "#999";
break; break;
case SCORE_LOG_INFO: $c = "#000"; case SCORE_LOG_INFO:
$c = "#000";
break; break;
case SCORE_LOG_WARNING: $c = "#800"; case SCORE_LOG_WARNING:
$c = "#800";
break; break;
case SCORE_LOG_ERROR: $c = "#C00"; case SCORE_LOG_ERROR:
$c = "#C00";
break; break;
case SCORE_LOG_CRITICAL: $c = "#F00"; case SCORE_LOG_CRITICAL:
$c = "#F00";
break; break;
} }
return SPAN(["style"=>"color: $c"], rawHTML($this->scan_entities($row[$this->name]))); return SPAN(["style"=>"color: $c"], rawHTML($this->scan_entities($row[$this->name])));

View file

@ -151,15 +151,20 @@ class RotateImage extends Extension
/* Output to the same format as the original image */ /* Output to the same format as the original image */
switch ($info[2]) { switch ($info[2]) {
case IMAGETYPE_GIF: $result = imagegif($image_rotated, $tmp_filename); case IMAGETYPE_GIF:
$result = imagegif($image_rotated, $tmp_filename);
break; break;
case IMAGETYPE_JPEG: $result = imagejpeg($image_rotated, $tmp_filename); case IMAGETYPE_JPEG:
$result = imagejpeg($image_rotated, $tmp_filename);
break; break;
case IMAGETYPE_PNG: $result = imagepng($image_rotated, $tmp_filename, 9); case IMAGETYPE_PNG:
$result = imagepng($image_rotated, $tmp_filename, 9);
break; break;
case IMAGETYPE_WEBP: $result = imagewebp($image_rotated, $tmp_filename); case IMAGETYPE_WEBP:
$result = imagewebp($image_rotated, $tmp_filename);
break; break;
case IMAGETYPE_BMP: $result = imagebmp($image_rotated, $tmp_filename, true); case IMAGETYPE_BMP:
$result = imagebmp($image_rotated, $tmp_filename, true);
break; break;
default: default:
throw new ImageRotateException("Unsupported image type."); throw new ImageRotateException("Unsupported image type.");

View file

@ -396,13 +396,17 @@ class Setup extends Extension
$type = $_POST["_type_$name"]; $type = $_POST["_type_$name"];
$value = isset($_POST["_config_$name"]) ? $_POST["_config_$name"] : null; $value = isset($_POST["_config_$name"]) ? $_POST["_config_$name"] : null;
switch ($type) { switch ($type) {
case "string": $config->set_string($name, $value); case "string":
$config->set_string($name, $value);
break; break;
case "int": $config->set_int($name, parse_shorthand_int((string)$value)); case "int":
$config->set_int($name, parse_shorthand_int((string)$value));
break; break;
case "bool": $config->set_bool($name, bool_escape($value)); case "bool":
$config->set_bool($name, bool_escape($value));
break; break;
case "array": $config->set_array($name, $value); case "array":
$config->set_array($name, $value);
break; break;
} }
} }