Fix return type

This commit is contained in:
SENOO, Ken 2022-10-15 16:17:31 +09:00
parent 7f41ca5729
commit 7d07dd9861

View File

@ -131,7 +131,7 @@ class QvitterPlugin extends Plugin {
}
function onCheckSchema()
function onCheckSchema(): bool
{
$schema = Schema::get();
@ -151,7 +151,7 @@ class QvitterPlugin extends Plugin {
return true;
}
public function onBeforePluginCheckSchema()
public function onBeforePluginCheckSchema(): bool
{
QvitterNotification::beforeSchemaUpdate();
return true;
@ -485,7 +485,7 @@ class QvitterPlugin extends Plugin {
* @return boolean hook return
*/
function onEndAccountSettingsNav($action)
function onEndAccountSettingsNav($action): bool
{
$action_name = $action->trimmed('action');
@ -507,7 +507,7 @@ class QvitterPlugin extends Plugin {
* @return boolean hook return
*/
function onEndAdminPanelNav($action)
function onEndAdminPanelNav($action): bool
{
$action_name = $action->trimmed('action');
@ -829,7 +829,7 @@ class QvitterPlugin extends Plugin {
* @return boolean hook return
*/
function onTwitterUserArray($profile, &$twitter_user, $scoped)
function onTwitterUserArray($profile, &$twitter_user, $scoped): bool
{
$twitter_user['cover_photo'] = Profile_prefs::getConfigData($profile, 'qvitter', 'cover_photo');
@ -964,7 +964,7 @@ class QvitterPlugin extends Plugin {
/**
* Remove likes in notification table on dislike
*/
public function onEndDisfavorNotice($profile, $notice)
public function onEndDisfavorNotice($profile, $notice): bool
{
$notif = new QvitterNotification();
$notif->from_profile_id = $profile->id;
@ -981,7 +981,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
function onStartNoticeDistribute($notice) {
function onStartNoticeDistribute($notice): bool {
assert($notice->id > 0); // since we removed tests below
@ -1061,7 +1061,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onNoticeDeleteRelated($notice)
public function onNoticeDeleteRelated($notice): bool
{
$notif = new QvitterNotification();
@ -1129,7 +1129,7 @@ class QvitterPlugin extends Plugin {
* @return boolean hook flag
*/
public function onEndHandleFeedEntry($activity) {
public function onEndHandleFeedEntry($activity): bool {
if($activity->verb == 'qvitter-delete-notice' && class_exists('StatusNet') && !array_key_exists('ActivityModeration', StatusNet::getActivePlugins())) {
@ -1170,7 +1170,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onEndSubscribe($subscriber, $other)
public function onEndSubscribe($subscriber, $other): bool
{
if(Subscription::exists($subscriber, $other)) {
$this->insertNotification($other->id, $subscriber->id, 'follow', 1);
@ -1178,7 +1178,7 @@ class QvitterPlugin extends Plugin {
return true;
}
public function onEndUnsubscribe($subscriber, $other)
public function onEndUnsubscribe($subscriber, $other): bool
{
if(!Subscription::exists($subscriber, $other)) {
$notif = new QvitterNotification();
@ -1196,7 +1196,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onEndLoadDoc($title, &$output)
public function onEndLoadDoc($title, &$output): bool
{
if($title == 'faq') {
@ -1221,7 +1221,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onStartPrimaryNav($action)
public function onStartPrimaryNav($action): bool
{
$action->menuItem(common_local_url('doc', array('title' => 'faq')),
@ -1241,7 +1241,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onStartUserRegister($profile)
public function onStartUserRegister($profile): bool
{
if(is_array(self::settings("blocked_ips"))) {
@ -1260,7 +1260,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onEndFindMentions($sender, $text, &$mentions) {
public function onEndFindMentions($sender, $text, &$mentions): bool {
// get the correct group profiles
if(isset($_POST['post_to_groups'])) {
@ -1298,7 +1298,7 @@ class QvitterPlugin extends Plugin {
*
* @return boolean hook flag
*/
public function onEndSetApiUser($user) {
public function onEndSetApiUser($user): bool {
// cleanup sessions, to allow for simultaneous http-requests,
// e.g. if posting a notice takes a very long time
@ -1369,7 +1369,7 @@ class QvitterPlugin extends Plugin {
}
function onPluginVersion(array &$versions)
function onPluginVersion(array &$versions): bool
{
$versions[] = array('name' => 'Qvitter',
'version' => '5-alpha',