4 Commits cf20b200bc ... 116af3e867

Author SHA1 Message Date
  Hugo Sales 116af3e867 [WIP][TOOLS][PHPStan] Raise PHPStan level to 4 and fix issues found 2 years ago
  Hugo Sales c7e5eeb571 [CORE] Fix `Undefined array key 0` in `DB::filterTableName` 2 years ago
  Eliseu Amaro 940b852704 [BASE] Importing fonts through CSS instead, minimizing content blocking. Removed legibility optimizations in font rendering. Removed unused font rules. 2 years ago
  Eliseu Amaro cac34ccc83 [THEME][DARK] Background image is 73% smaller, added noise to diminish the banding in Firefox. 2 years ago

+ 5 - 5
phpstan.neon

@@ -1,5 +1,5 @@
 parameters:
-    level: 3
+    level: 4
     bootstrapFiles:
         - config/bootstrap.php
     earlyTerminatingMethodCalls:
@@ -10,10 +10,10 @@ parameters:
             message: '/Access to an undefined property App\\Util\\Bitmap::\$\w+/'
             paths:
                 - *
-        # -
-        #     message: '/has no return typehint specified/'
-        #     paths:
-        #         - tests/*
+        -
+            message: '/has no return typehint specified/'
+            paths:
+                - tests/*
 
 services:
     -

+ 4 - 12
plugins/Favourite/Favourite.php

@@ -24,6 +24,7 @@ namespace Plugin\Favourite;
 use App\Core\DB\DB;
 use App\Core\Event;
 use App\Core\Form;
+use function App\Core\I18n\_m;
 use App\Core\Modules\NoteHandlerPlugin;
 use App\Core\Router\RouteLoader;
 use App\Entity\Note;
@@ -36,7 +37,6 @@ use App\Util\Nickname;
 use Symfony\Component\Form\Extension\Core\Type\HiddenType;
 use Symfony\Component\Form\Extension\Core\Type\SubmitType;
 use Symfony\Component\HttpFoundation\Request;
-use function App\Core\I18n\_m;
 
 class Favourite extends NoteHandlerPlugin
 {
@@ -77,8 +77,10 @@ class Favourite extends NoteHandlerPlugin
             ["favourite-{$note->getId()}", HiddenType::class, ['data' => $is_set ? '1' : '0']],
         ]);
 
+        $actions[] = $form_fav->createView();
+
         // Form handler
-        $ret = self::noteActionHandle(
+        return self::noteActionHandle(
             $request, $form_fav, $note, "favourite-{$note->getId()}",
             /**
              * Called from form handler
@@ -99,19 +101,9 @@ class Favourite extends NoteHandlerPlugin
                         DB::flush();
                     }
                 }
-
                 // Prevent accidental refreshes from resubmitting the form
                 throw new RedirectException();
-
-                return Event::stop;
             });
-
-        if ($ret !== null) {
-            return $ret;
-        }
-
-        $actions[] = $form_fav->createView();
-        return Event::next;
     }
 
     public function onInsertLeftPanelLink(string $user_nickname, &$res): bool

+ 1 - 0
plugins/ImageEncoder/Controller/ImageThumbnail.php

@@ -39,6 +39,7 @@ class ImageThumbnail extends Controller
         if (!is_null($attachment->getScope())) {
             // && ($attachment->scope | VisibilityScope::PUBLIC) != 0
             // $user = Common::ensureLoggedIn();
+            // @phpstan-ignore-next-line
             assert(false, 'Attachment scope not implemented');
         }
 

File diff suppressed because it is too large
+ 20 - 8
public/assets/css/base.css


+ 0 - 2
public/assets/css/reset.css

@@ -75,8 +75,6 @@ body,
 html {
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
-    text-rendering: optimizeLegibility;
-    scroll-behavior: smooth;
 
     background-attachment: fixed;
     color: var(--white);

+ 1 - 194
public/assets/fonts/inter/inter.css

@@ -1,175 +1,4 @@
 @font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 100;
-    font-display: swap;
-    src: url("Inter-Thin.woff2?v=3.19") format("woff2"),
-    url("Inter-Thin.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 100;
-    font-display: swap;
-    src: url("Inter-ThinItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-ThinItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 200;
-    font-display: swap;
-    src: url("Inter-ExtraLight.woff2?v=3.19") format("woff2"),
-    url("Inter-ExtraLight.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 200;
-    font-display: swap;
-    src: url("Inter-ExtraLightItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-ExtraLightItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 300;
-    font-display: swap;
-    src: url("Inter-Light.woff2?v=3.19") format("woff2"),
-    url("Inter-Light.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 300;
-    font-display: swap;
-    src: url("Inter-LightItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-LightItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 400;
-    font-display: swap;
-    src: url("Inter-Regular.woff2?v=3.19") format("woff2"),
-    url("Inter-Regular.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 400;
-    font-display: swap;
-    src: url("Inter-Italic.woff2?v=3.19") format("woff2"),
-    url("Inter-Italic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 500;
-    font-display: swap;
-    src: url("Inter-Medium.woff2?v=3.19") format("woff2"),
-    url("Inter-Medium.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 500;
-    font-display: swap;
-    src: url("Inter-MediumItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-MediumItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 600;
-    font-display: swap;
-    src: url("Inter-SemiBold.woff2?v=3.19") format("woff2"),
-    url("Inter-SemiBold.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 600;
-    font-display: swap;
-    src: url("Inter-SemiBoldItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-SemiBoldItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 700;
-    font-display: swap;
-    src: url("Inter-Bold.woff2?v=3.19") format("woff2"),
-    url("Inter-Bold.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 700;
-    font-display: swap;
-    src: url("Inter-BoldItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-BoldItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 800;
-    font-display: swap;
-    src: url("Inter-ExtraBold.woff2?v=3.19") format("woff2"),
-    url("Inter-ExtraBold.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 800;
-    font-display: swap;
-    src: url("Inter-ExtraBoldItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-ExtraBoldItalic.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: normal;
-    font-weight: 900;
-    font-display: swap;
-    src: url("Inter-Black.woff2?v=3.19") format("woff2"),
-    url("Inter-Black.woff?v=3.19") format("woff");
-}
-
-@font-face {
-    font-family: 'Inter';
-    font-style: italic;
-    font-weight: 900;
-    font-display: swap;
-    src: url("Inter-BlackItalic.woff2?v=3.19") format("woff2"),
-    url("Inter-BlackItalic.woff?v=3.19") format("woff");
-}
-
-/* -------------------------------------------------------
-Variable font.
-Usage:
-
-  html { font-family: 'Inter', sans-serif; }
-  @supports (font-variation-settings: normal) {
-    html { font-family: 'Inter var', sans-serif; }
-  }
-*/
-@font-face {
     font-family: 'Inter var';
     font-weight: 100 900;
     font-display: swap;
@@ -185,26 +14,4 @@ Usage:
     font-style: italic;
     font-named-instance: 'Italic';
     src: url("Inter-italic.var.woff2?v=3.19") format("woff2");
-}
-
-
-/* --------------------------------------------------------------------------
-[EXPERIMENTAL] Multi-axis, single variable font.
-
-Slant axis is not yet widely supported (as of February 2019) and thus this
-multi-axis single variable font is opt-in rather than the default.
-
-When using this, you will probably need to set font-variation-settings
-explicitly, e.g.
-
-  * { font-variation-settings: "slnt" 0deg }
-  .italic { font-variation-settings: "slnt" 10deg }
-
-*/
-@font-face {
-    font-family: 'Inter var experimental';
-    font-weight: 100 900;
-    font-display: swap;
-    font-style: oblique 0deg 10deg;
-    src: url("Inter.var.woff2?v=3.19") format("woff2");
-}
+}

BIN
public/assets/images/bg-light.png


BIN
public/assets/images/bg.png


+ 3 - 2
src/Controller/UserPanel.php

@@ -39,6 +39,7 @@ use App\Core\DB\DB;
 use App\Core\Event;
 use App\Core\Form;
 use function App\Core\I18n\_m;
+use App\Core\Log;
 use App\Entity\UserNotificationPrefs;
 use App\Util\Common;
 use App\Util\Exception\AuthenticationException;
@@ -198,8 +199,8 @@ class UserPanel extends AbstractController
                 break;
             default:
                 // @codeCoverageIgnoreStart
-                throw new ServerException(_m('Internal server error'));
                 Log::critical("Structure of table user_notification_prefs changed in a way not accounted to in notification settings ({$name}): " . $type_str);
+                throw new ServerException(_m('Internal server error'));
                 // @codeCoverageIgnoreEnd
             }
         }
@@ -211,7 +212,7 @@ class UserPanel extends AbstractController
         unset($form_defs['placeholder']);
 
         $tabbed_forms = [];
-        foreach ($form_defs as $transport_name => $f) {
+        foreach ($form_defs as $transport_name => $f) { // @phpstan-ignore-line TODO add stan support for the event system
             unset($f['save']);
             $form                          = Form::create($f);
             $tabbed_forms[$transport_name] = $form;

+ 0 - 0
src/Core/Cache.php


Some files were not shown because too many files changed in this diff