From: Banana Date: Wed, 22 Nov 2023 13:20:57 +0000 (+0100) Subject: removed ifset and replaced it with Null coalescing operator X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=1a9637b579e569ef707207bf770b8fd912f50a41;p=insipid.git removed ifset and replaced it with Null coalescing operator --- diff --git a/TODO b/TODO index 0795fe3..be97768 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ TODO / Feature list -+ Replace ifset https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op - from summoner.class.php ++ combine category and tag class into one. ++ installer + Whole Page snapshot + view table really still needed? + theme support -+ combine category and tag class into one. + diff --git a/webroot/lib/summoner.class.php b/webroot/lib/summoner.class.php index fa9b292..b1b33b8 100644 --- a/webroot/lib/summoner.class.php +++ b/webroot/lib/summoner.class.php @@ -207,20 +207,7 @@ class Summoner { return $ret; } - - /** - * simulate the Null coalescing operator in php5 - * this only works with arrays and checking if the key is there and echo/return it. - * http://php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op - * - * @param array $array - * @param string $key - * @return mixed - */ - static function ifset(array $array, string $key): mixed { - return $array[$key] ?? false; - } - + /** * try to gather meta information from given URL * diff --git a/webroot/view/editlink.php b/webroot/view/editlink.php index 5523a1f..1ae23b6 100644 --- a/webroot/view/editlink.php +++ b/webroot/view/editlink.php @@ -36,7 +36,7 @@
@@ -61,7 +61,7 @@

t('view.title'); ?>

- +
@@ -69,7 +69,7 @@

t('view.description'); ?>

- +
@@ -90,10 +90,10 @@

<?php echo $T->t('view.image.noimage'); ?>

-
+

@@ -109,7 +109,7 @@

t('edit.link.thumbnail.view'); ?>

@@ -126,7 +126,7 @@

t('edit.link.full.screenshot.view'); ?>

@@ -213,7 +213,7 @@
diff --git a/webroot/view/home.php b/webroot/view/home.php index 5c830c6..5f5a3f1 100644 --- a/webroot/view/home.php +++ b/webroot/view/home.php @@ -88,7 +88,7 @@
- + @@ -103,7 +103,7 @@
- +
@@ -111,7 +111,7 @@
- +
@@ -119,13 +119,13 @@
- <?php echo $T->t('view.image.of.link'); ?> + <?php echo $T->t('view.image.of.link'); ?>
- +
@@ -207,7 +207,7 @@