diff options
author | Andrew Dolgov <[email protected]> | 2021-11-18 07:32:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-11-18 07:32:28 +0300 |
commit | 63ec5a89657bb7f9650582b96e0bb255a0889b48 (patch) | |
tree | 074b61eedd7304ba1d8d7deec01d26973ef8e6b8 /update.php | |
parent | 3a3fde1a2e0beac6d179c6449eaad726100710d7 (diff) | |
parent | 2d830c6281c19a7ee29cd379f5aedc82deef3775 (diff) |
Merge branch 'wip-phpstan-level6'
Diffstat (limited to 'update.php')
-rwxr-xr-x | update.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/update.php b/update.php index b10dde400..90251c2f3 100755 --- a/update.php +++ b/update.php @@ -12,7 +12,7 @@ Config::sanity_check(); - function make_stampfile($filename) { + function make_stampfile(string $filename): bool { $fp = fopen(Config::get(Config::LOCK_DIRECTORY) . "/$filename", "w"); if (flock($fp, LOCK_EX | LOCK_NB)) { @@ -25,7 +25,7 @@ } } - function cleanup_tags($days = 14, $limit = 1000) { + function cleanup_tags(int $days = 14, int $limit = 1000): int { $days = (int) $days; @@ -97,7 +97,7 @@ ]; foreach (PluginHost::getInstance()->get_commands() as $command => $data) { - $options_map[$command . $data["suffix"]] = [ $data["arghelp"] ?? "", $data["description"] ]; + $options_map[$command . $data["suffix"]] = [ $data["arghelp"], $data["description"] ]; } if (php_sapi_name() != "cli") { @@ -108,7 +108,7 @@ $options = getopt("", array_keys($options_map)); - if (count($options) == 0 || isset($options["help"]) ) { + if ($options === false || count($options) == 0 || isset($options["help"]) ) { print "Tiny Tiny RSS CLI management tool\n"; print "=================================\n"; print "Options:\n\n"; @@ -378,7 +378,7 @@ Debug::log("Exporting feeds of user $user to $filename as OPML..."); if ($owner_uid = UserHelper::find_user_by_login($user)) { - $opml = new OPML(""); + $opml = new OPML([]); $rc = $opml->opml_export($filename, $owner_uid, false, true, true); @@ -394,7 +394,7 @@ Debug::log("Importing feeds of user $user from OPML file $filename..."); if ($owner_uid = UserHelper::find_user_by_login($user)) { - $opml = new OPML(""); + $opml = new OPML([]); $rc = $opml->opml_import($owner_uid, $filename); |