new php-cs-fixer, new opinions about what is today's preferred format...
This commit is contained in:
parent
ebc78f8996
commit
4ff93c63c3
25 changed files with 659 additions and 979 deletions
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"phpunit/phpunit" : "^9.0",
|
"phpunit/phpunit" : "^9.0",
|
||||||
"friendsofphp/php-cs-fixer" : "^3.4"
|
"friendsofphp/php-cs-fixer" : "^3.12"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-memcache": "memcache caching",
|
"ext-memcache": "memcache caching",
|
||||||
|
|
976
composer.lock
generated
976
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -529,7 +529,8 @@ function parse_shorthand_int(string $limit): int
|
||||||
// no break
|
// no break
|
||||||
case 'm': $value *= 1024; // fall through
|
case 'm': $value *= 1024; // fall through
|
||||||
// no break
|
// no break
|
||||||
case 'k': $value *= 1024; break;
|
case 'k': $value *= 1024;
|
||||||
|
break;
|
||||||
default: $value = -1;
|
default: $value = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
use MicroHTML\HTMLElement;
|
use MicroHTML\HTMLElement;
|
||||||
|
|
||||||
use function MicroHTML\emptyHTML;
|
use function MicroHTML\emptyHTML;
|
||||||
use function MicroHTML\rawHTML;
|
use function MicroHTML\rawHTML;
|
||||||
use function MicroHTML\FORM;
|
use function MicroHTML\FORM;
|
||||||
|
|
|
@ -171,11 +171,16 @@ 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(); break;
|
case "add": $this->onPageRequest_add();
|
||||||
case "delete": $this->onPageRequest_delete($event); break;
|
break;
|
||||||
case "bulk_delete": $this->onPageRequest_bulk_delete(); break;
|
case "delete": $this->onPageRequest_delete($event);
|
||||||
case "list": $this->onPageRequest_list($event); break;
|
break;
|
||||||
case "beta-search": $this->onPageRequest_beta_search($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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
use MicroHTML\HTMLElement;
|
use MicroHTML\HTMLElement;
|
||||||
|
|
||||||
use function MicroHTML\INPUT;
|
use function MicroHTML\INPUT;
|
||||||
|
|
||||||
class FavoritesTheme extends Themelet
|
class FavoritesTheme extends Themelet
|
||||||
|
|
|
@ -8,6 +8,7 @@ use MicroCRUD\Column;
|
||||||
use MicroCRUD\DateTimeColumn;
|
use MicroCRUD\DateTimeColumn;
|
||||||
use MicroCRUD\TextColumn;
|
use MicroCRUD\TextColumn;
|
||||||
use MicroCRUD\Table;
|
use MicroCRUD\Table;
|
||||||
|
|
||||||
use function MicroHTML\A;
|
use function MicroHTML\A;
|
||||||
use function MicroHTML\SPAN;
|
use function MicroHTML\SPAN;
|
||||||
use function MicroHTML\emptyHTML;
|
use function MicroHTML\emptyHTML;
|
||||||
|
@ -161,11 +162,16 @@ class MessageColumn extends Column
|
||||||
{
|
{
|
||||||
$c = "#000";
|
$c = "#000";
|
||||||
switch ($row['priority']) {
|
switch ($row['priority']) {
|
||||||
case SCORE_LOG_DEBUG: $c = "#999"; break;
|
case SCORE_LOG_DEBUG: $c = "#999";
|
||||||
case SCORE_LOG_INFO: $c = "#000"; break;
|
break;
|
||||||
case SCORE_LOG_WARNING: $c = "#800"; break;
|
case SCORE_LOG_INFO: $c = "#000";
|
||||||
case SCORE_LOG_ERROR: $c = "#C00"; break;
|
break;
|
||||||
case SCORE_LOG_CRITICAL: $c = "#F00"; 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])));
|
return SPAN(["style"=>"color: $c"], rawHTML($this->scan_entities($row[$this->name])));
|
||||||
}
|
}
|
||||||
|
|
|
@ -791,7 +791,6 @@ class Media extends Extension
|
||||||
imagedestroy($image_resized);
|
imagedestroy($image_resized);
|
||||||
$image_resized = $new_image;
|
$image_resized = $new_image;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($output_mime) {
|
switch ($output_mime) {
|
||||||
|
|
|
@ -345,14 +345,12 @@ class Pools extends Extension
|
||||||
$image_order = $image_order + 1;
|
$image_order = $image_order + 1;
|
||||||
}
|
}
|
||||||
$database->commit();
|
$database->commit();
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$database->rollback();
|
$database->rollback();
|
||||||
}
|
}
|
||||||
$page->set_mode(PageMode::REDIRECT);
|
$page->set_mode(PageMode::REDIRECT);
|
||||||
$page->set_redirect(make_link("pool/view/" . $pool_id));
|
$page->set_redirect(make_link("pool/view/" . $pool_id));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->theme->display_error(403, "Permission Denied", "You do not have permission to access this page");
|
$this->theme->display_error(403, "Permission Denied", "You do not have permission to access this page");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -522,7 +520,6 @@ class Pools extends Extension
|
||||||
$poolID = str_replace("_", " ", $matches[1]);
|
$poolID = str_replace("_", " ", $matches[1]);
|
||||||
$event->add_querylet(new Querylet("images.id IN (SELECT DISTINCT image_id FROM pool_images WHERE pool_id = $poolID)"));
|
$event->add_querylet(new Querylet("images.id IN (SELECT DISTINCT image_id FROM pool_images WHERE pool_id = $poolID)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onTagTermCheck(TagTermCheckEvent $event)
|
public function onTagTermCheck(TagTermCheckEvent $event)
|
||||||
|
|
|
@ -134,10 +134,8 @@ class ResizeImage extends Extension
|
||||||
if (is_null($image)) {
|
if (is_null($image)) {
|
||||||
$this->theme->display_error(404, "Post not found", "No image in the database has the ID #$image_id");
|
$this->theme->display_error(404, "Post not found", "No image in the database has the ID #$image_id");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* Check if options were given to resize an image. */
|
/* Check if options were given to resize an image. */
|
||||||
if (isset($_POST['resize_width']) || isset($_POST['resize_height'])) {
|
if (isset($_POST['resize_width']) || isset($_POST['resize_height'])) {
|
||||||
|
|
||||||
/* get options */
|
/* get options */
|
||||||
|
|
||||||
$width = $height = 0;
|
$width = $height = 0;
|
||||||
|
|
|
@ -65,10 +65,8 @@ class RotateImage extends Extension
|
||||||
if (is_null($image)) {
|
if (is_null($image)) {
|
||||||
$this->theme->display_error(404, "Post not found", "No image in the database has the ID #$image_id");
|
$this->theme->display_error(404, "Post not found", "No image in the database has the ID #$image_id");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* Check if options were given to rotate an image. */
|
/* Check if options were given to rotate an image. */
|
||||||
if (isset($_POST['rotate_deg'])) {
|
if (isset($_POST['rotate_deg'])) {
|
||||||
|
|
||||||
/* get options */
|
/* get options */
|
||||||
|
|
||||||
$deg = 0;
|
$deg = 0;
|
||||||
|
@ -153,11 +151,16 @@ 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); break;
|
case IMAGETYPE_GIF: $result = imagegif($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); break;
|
case IMAGETYPE_JPEG: $result = imagejpeg($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); 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:
|
default:
|
||||||
throw new ImageRotateException("Unsupported image type.");
|
throw new ImageRotateException("Unsupported image type.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,10 +396,14 @@ 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); break;
|
case "string": $config->set_string($name, $value);
|
||||||
case "int": $config->set_int($name, parse_shorthand_int((string)$value)); break;
|
break;
|
||||||
case "bool": $config->set_bool($name, bool_escape($value)); break;
|
case "int": $config->set_int($name, parse_shorthand_int((string)$value));
|
||||||
case "array": $config->set_array($name, $value); break;
|
break;
|
||||||
|
case "bool": $config->set_bool($name, bool_escape($value));
|
||||||
|
break;
|
||||||
|
case "array": $config->set_array($name, $value);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use MicroHTML\HTMLElement;
|
use MicroHTML\HTMLElement;
|
||||||
|
|
||||||
use function MicroHTML\TABLE;
|
use function MicroHTML\TABLE;
|
||||||
use function MicroHTML\TR;
|
use function MicroHTML\TR;
|
||||||
use function MicroHTML\TD;
|
use function MicroHTML\TD;
|
||||||
|
|
|
@ -11,6 +11,7 @@ use MicroCRUD\IntegerColumn;
|
||||||
use MicroCRUD\TextColumn;
|
use MicroCRUD\TextColumn;
|
||||||
use MicroCRUD\DateColumn;
|
use MicroCRUD\DateColumn;
|
||||||
use MicroCRUD\Table;
|
use MicroCRUD\Table;
|
||||||
|
|
||||||
use function MicroHTML\A;
|
use function MicroHTML\A;
|
||||||
|
|
||||||
class UserNameColumn extends TextColumn
|
class UserNameColumn extends TextColumn
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
use MicroHTML\HTMLElement;
|
use MicroHTML\HTMLElement;
|
||||||
|
|
||||||
use function MicroHTML\emptyHTML;
|
use function MicroHTML\emptyHTML;
|
||||||
use function MicroHTML\rawHTML;
|
use function MicroHTML\rawHTML;
|
||||||
use function MicroHTML\TABLE;
|
use function MicroHTML\TABLE;
|
||||||
|
|
|
@ -552,7 +552,6 @@ class Wiki extends Extension
|
||||||
and
|
and
|
||||||
$fstop++ < 10 # and the distance is lower than 10 lines
|
$fstop++ < 10 # and the distance is lower than 10 lines
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test the left side for a hit
|
* test the left side for a hit
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MicroHTML\HTMLElement;
|
use MicroHTML\HTMLElement;
|
||||||
|
|
||||||
use function MicroHTML\A;
|
use function MicroHTML\A;
|
||||||
|
|
||||||
class CustomUploadTheme extends UploadTheme
|
class CustomUploadTheme extends UploadTheme
|
||||||
|
|
Reference in a new issue