mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 05:15:55 +00:00
deal with some warnings in plugins/trgm,readability and base plugin class
This commit is contained in:
@@ -20,7 +20,7 @@ abstract class Plugin {
|
|||||||
$this->pdo = Db::pdo();
|
$this->pdo = Db::pdo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return array<string,int> */
|
/** @return array<string,bool> */
|
||||||
function flags() {
|
function flags() {
|
||||||
/* associative array, possible keys:
|
/* associative array, possible keys:
|
||||||
needs_curl = boolean
|
needs_curl = boolean
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
class Af_Psql_Trgm extends Plugin {
|
class Af_Psql_Trgm extends Plugin {
|
||||||
|
|
||||||
/* @var PluginHost $host */
|
/** @var PluginHost $host */
|
||||||
private $host;
|
private $host;
|
||||||
|
|
||||||
|
/** @var float */
|
||||||
private $default_similarity = 0.75;
|
private $default_similarity = 0.75;
|
||||||
|
|
||||||
|
/** @var int */
|
||||||
private $default_min_length = 32;
|
private $default_min_length = 32;
|
||||||
|
|
||||||
function about() {
|
function about() {
|
||||||
@@ -12,6 +16,7 @@ class Af_Psql_Trgm extends Plugin {
|
|||||||
"fox");
|
"fox");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function save() {
|
function save() {
|
||||||
$similarity = (float) $_POST["similarity"];
|
$similarity = (float) $_POST["similarity"];
|
||||||
$min_title_length = (int) $_POST["min_title_length"];
|
$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 file_get_contents(__DIR__ . "/init.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function showrelated() {
|
function showrelated() {
|
||||||
$id = (int) $_REQUEST['id'];
|
$id = (int) $_REQUEST['id'];
|
||||||
$owner_uid = $_SESSION["uid"];
|
$owner_uid = $_SESSION["uid"];
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use \andreskrey\Readability\Configuration;
|
|||||||
|
|
||||||
class Af_Readability extends Plugin {
|
class Af_Readability extends Plugin {
|
||||||
|
|
||||||
/* @var PluginHost $host */
|
/** @var PluginHost $host */
|
||||||
private $host;
|
private $host;
|
||||||
|
|
||||||
function about() {
|
function about() {
|
||||||
@@ -19,6 +19,7 @@ class Af_Readability extends Plugin {
|
|||||||
return array("needs_curl" => true);
|
return array("needs_curl" => true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function save() {
|
function save() {
|
||||||
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"] ?? "");
|
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"] ?? "");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user