chore: fix code style

This commit is contained in:
Art4 2026-03-14 15:22:10 +01:00
commit da46df0af2
7 changed files with 25 additions and 22 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
/**
* Copyright (C) 2010-2024, the Friendica project
* SPDX-FileCopyrightText: 2010-2024 the Friendica project

View file

@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
/**
* Copyright (C) 2010-2024, the Friendica project
* SPDX-FileCopyrightText: 2010-2024 the Friendica project

View file

@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
/**
* Copyright (C) 2010-2024, the Friendica project
* SPDX-FileCopyrightText: 2010-2024 the Friendica project

View file

@ -24,9 +24,9 @@ class StrategiesFileManager
* The default hook-file-key of strategies
* -> it's an empty string to cover empty/missing config values
*/
const STRATEGY_DEFAULT_KEY = '';
const STATIC_DIR = 'static';
const CONFIG_NAME = 'strategies';
public const STRATEGY_DEFAULT_KEY = '';
public const STATIC_DIR = 'static';
public const CONFIG_NAME = 'strategies';
private IManageConfigValues $configuration;
protected array $config = [];

View file

@ -32,10 +32,10 @@ use Psr\Log\LoggerInterface;
class Create extends BaseModule
{
const CONTACT_ACTION_NONE = 0;
const CONTACT_ACTION_COLLAPSE = 1;
const CONTACT_ACTION_IGNORE = 2;
const CONTACT_ACTION_BLOCK = 3;
public const CONTACT_ACTION_NONE = 0;
public const CONTACT_ACTION_COLLAPSE = 1;
public const CONTACT_ACTION_IGNORE = 2;
public const CONTACT_ACTION_BLOCK = 3;
/** @var SystemMessages */
private $systemMessages;
@ -99,7 +99,7 @@ class Create extends BaseModule
!empty($request['rule-ids']) ? explode(',', $request['rule-ids']) : [],
$this->session->get('report_comment') ?? '',
!empty($request['uri-ids']) ? explode(',', $request['uri-ids']) : [],
(bool)($request['forward'] ?? false),
(bool) ($request['forward'] ?? false),
);
$this->repository->save($report);
@ -228,14 +228,14 @@ class Create extends BaseModule
DI::userSession()->getLocalUserId(),
'system',
'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile')
DI::config()->get('system', 'itemspage_network_mobile'),
);
} else {
$itemsPerPage = DI::pConfig()->get(
DI::userSession()->getLocalUserId(),
'system',
'itemspage_network',
DI::config()->get('system', 'itemspage_network')
DI::config()->get('system', 'itemspage_network'),
);
}

View file

@ -63,7 +63,7 @@ class Channels extends BaseSettings
$channel_languages = User::getWantedLanguages($uid);
if (!empty($request['add_channel'])) {
if (!array_diff((array)$request['new_languages'], $channel_languages)) {
if (!array_diff((array) $request['new_languages'], $channel_languages)) {
$request['new_languages'] = null;
}
@ -72,11 +72,11 @@ class Channels extends BaseSettings
'description' => $request['new_description'],
'access-key' => substr(mb_strtolower($request['new_access_key']), 0, 1),
'uid' => $uid,
'circle' => (int)$request['new_circle'],
'circle' => (int) $request['new_circle'],
'include-tags' => Strings::cleanTags($request['new_include_tags']),
'exclude-tags' => Strings::cleanTags($request['new_exclude_tags']),
'min-size' => $request['new_min_size'] != '' ? (int)$request['new_min_size'] : null,
'max-size' => $request['new_max_size'] != '' ? (int)$request['new_max_size'] : null,
'min-size' => $request['new_min_size'] != '' ? (int) $request['new_min_size'] : null,
'max-size' => $request['new_max_size'] != '' ? (int) $request['new_max_size'] : null,
'full-text-search' => $request['new_text_search'],
'media-type' => ($request['new_image'] ? 1 : 0) | ($request['new_video'] ? 2 : 0) | ($request['new_audio'] ? 4 : 0),
'languages' => $request['new_languages'],
@ -90,14 +90,14 @@ class Channels extends BaseSettings
return;
}
foreach (array_keys((array)$request['label']) as $id) {
foreach (array_keys((array) $request['label']) as $id) {
if ($request['delete'][$id]) {
$success = $this->channel->deleteById($id, $uid);
$this->logger->debug('Channel deleted', ['id' => $id, 'success' => $success]);
continue;
}
if (!array_diff((array)$request['languages'][$id], $channel_languages) && (count((array)$request['languages'][$id]) == count($channel_languages))) {
if (!array_diff((array) $request['languages'][$id], $channel_languages) && (count((array) $request['languages'][$id]) == count($channel_languages))) {
$request['languages'][$id] = null;
}
@ -107,11 +107,11 @@ class Channels extends BaseSettings
'description' => $request['description'][$id],
'access-key' => substr(mb_strtolower($request['access_key'][$id]), 0, 1),
'uid' => $uid,
'circle' => (int)$request['circle'][$id],
'circle' => (int) $request['circle'][$id],
'include-tags' => Strings::cleanTags($request['include_tags'][$id]),
'exclude-tags' => Strings::cleanTags($request['exclude_tags'][$id]),
'min-size' => $request['min_size'][$id] != '' ? (int)$request['min_size'][$id] : null,
'max-size' => $request['max_size'][$id] != '' ? (int)$request['max_size'][$id] : null,
'min-size' => $request['min_size'][$id] != '' ? (int) $request['min_size'][$id] : null,
'max-size' => $request['max_size'][$id] != '' ? (int) $request['max_size'][$id] : null,
'full-text-search' => $request['text_search'][$id],
'media-type' => ($request['image'][$id] ? 1 : 0) | ($request['video'][$id] ? 2 : 0) | ($request['audio'][$id] ? 4 : 0),
'languages' => $request['languages'][$id],
@ -141,7 +141,7 @@ class Channels extends BaseSettings
if (in_array($account_type, [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) {
$intro = $this->t('This page can be used to define the channels that will automatically be reshared by your account.');
$circles = [
EntityUserDefinedChannel::CIRCLE_GLOBAL => $this->l10n->t('Global Community')
EntityUserDefinedChannel::CIRCLE_GLOBAL => $this->l10n->t('Global Community'),
];
} else {
$intro = $this->t('This page can be used to define your own channels.');
@ -195,7 +195,7 @@ class Channels extends BaseSettings
'audio' => ["audio[$channel->code]", $this->t("Audio"), $channel->mediaType & 4],
'languages' => ["languages[$channel->code][]", $this->t('Languages'), $channel->languages ?? $channel_languages, $this->t('Select all languages that you want to see in this channel. "Unspecified" describes all posts for which no language information was detected (e.g. posts with just an image or too little text to be sure of the language). If you want to see all languages, you will need to select all items in the list.'), $languages, 'multiple'],
'publish' => $publish,
'delete' => ["delete[$channel->code]", $this->t("Delete channel") . ' (' . $channel->label . ')', false, $this->t("Check to delete this entry from the channel list")]
'delete' => ["delete[$channel->code]", $this->t("Delete channel") . ' (' . $channel->label . ')', false, $this->t("Check to delete this entry from the channel list")],
];
}

View file

@ -675,7 +675,7 @@ return [
Friendica\Core\Worker::PRIORITY_HIGH => 10,
Friendica\Core\Worker::PRIORITY_MEDIUM => 60,
Friendica\Core\Worker::PRIORITY_LOW => 180,
Friendica\Core\Worker::PRIORITY_NEGLIGIBLE => 720
Friendica\Core\Worker::PRIORITY_NEGLIGIBLE => 720,
],
// worker_max_idletime (Integer)