deal with some warnings in plugins/trgm,readability and base plugin class

This commit is contained in:
Andrew Dolgov 2021-11-13 19:55:30 +03:00
parent 03d0692268
commit 618e96b793
3 changed files with 10 additions and 3 deletions

View File

@ -20,7 +20,7 @@ abstract class Plugin {
$this->pdo = Db::pdo();
}
/** @return array<string,int> */
/** @return array<string,bool> */
function flags() {
/* associative array, possible keys:
needs_curl = boolean

View File

@ -1,9 +1,13 @@
<?php
class Af_Psql_Trgm extends Plugin {
/* @var PluginHost $host */
/** @var PluginHost $host */
private $host;
/** @var float */
private $default_similarity = 0.75;
/** @var int */
private $default_min_length = 32;
function about() {
@ -12,6 +16,7 @@ class Af_Psql_Trgm extends Plugin {
"fox");
}
/** @return void */
function save() {
$similarity = (float) $_POST["similarity"];
$min_title_length = (int) $_POST["min_title_length"];
@ -45,6 +50,7 @@ class Af_Psql_Trgm extends Plugin {
return file_get_contents(__DIR__ . "/init.js");
}
/** @return void */
function showrelated() {
$id = (int) $_REQUEST['id'];
$owner_uid = $_SESSION["uid"];

View File

@ -6,7 +6,7 @@ use \andreskrey\Readability\Configuration;
class Af_Readability extends Plugin {
/* @var PluginHost $host */
/** @var PluginHost $host */
private $host;
function about() {
@ -19,6 +19,7 @@ class Af_Readability extends Plugin {
return array("needs_curl" => true);
}
/** @return void */
function save() {
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"] ?? "");