]> git.mxchange.org Git - friendica.git/commitdiff
Fix code style
authorArt4 <art4@wlabs.de>
Tue, 13 May 2025 06:18:41 +0000 (06:18 +0000)
committerArt4 <art4@wlabs.de>
Tue, 13 May 2025 06:18:41 +0000 (06:18 +0000)
17 files changed:
src/Core/Storage/Repository/StorageManager.php
src/Model/Item.php
src/Model/Profile.php
src/Module/Contact/Profile.php
src/Module/Conversation/Network.php
src/Module/Directory.php
src/Module/Friendica.php
src/Module/Moderation/BaseUsers.php
src/Module/ParseUrl.php
src/Module/Privacy/PermissionTooltip.php
src/Module/Profile/Photos.php
src/Module/Profile/Profile.php
src/Module/Register.php
src/Module/Search/Acl.php
src/Module/Settings/Profile/Index.php
src/Navigation/Notifications/Repository/Notify.php
tests/src/Core/Storage/Repository/StorageManagerTest.php

index 1de89dbddc9e2d01b1a184f61f2728bea72a91d1..36efa3a1bf785b257522557f69f5ba218b6f03f3 100644 (file)
@@ -76,12 +76,12 @@ class StorageManager
         */
        public function __construct(Database $dba, IManageConfigValues $config, LoggerInterface $logger, EventDispatcherInterface $eventDispatcher, L10n $l10n, bool $includeAddon = true)
        {
-               $this->dba           = $dba;
-               $this->config        = $config;
-               $this->logger        = $logger;
+               $this->dba             = $dba;
+               $this->config          = $config;
+               $this->logger          = $logger;
                $this->eventDispatcher = $eventDispatcher;
-               $this->l10n          = $l10n;
-               $this->validBackends = $config->get('storage', 'backends', self::DEFAULT_BACKENDS);
+               $this->l10n            = $l10n;
+               $this->validBackends   = $config->get('storage', 'backends', self::DEFAULT_BACKENDS);
 
                $currentName = $this->config->get('storage', 'name');
 
index 397b774fa67bb135b06197bca2dd85796170b143..3eb2b3b90b4f0761a577fa2d1aeb8514dc7941fc 100644 (file)
@@ -3051,7 +3051,7 @@ class Item
                        $hook_data = [
                                'rendered-html' => $item['rendered-html'],
                                'rendered-hash' => $item['rendered-hash'],
-                               'item' => $item,
+                               'item'          => $item,
                        ];
 
                        $eventDispatcher = DI::eventDispatcher();
index a647a58c786bb64815c441ecd56e4a868a085b9b..731a66cb2b8ca6e297157454c2088c602b8c051e 100644 (file)
@@ -480,7 +480,7 @@ class Profile
 
                $hook_data = [
                        'profile' => &$profile,
-                       'entry' => &$o,
+                       'entry'   => &$o,
                ];
 
                $hook_data = $eventDispatcher->dispatch(
@@ -488,7 +488,7 @@ class Profile
                )->getArray();
 
                $profile = $hook_data['profile'] ?? $profile;
-               $o = $hook_data['entry'] ?? $o;
+               $o       = $hook_data['entry']   ?? $o;
 
                return $o;
        }
index 83ea31839032ec26fa4f1c29e8875118e440569b..dd7288e58ce3363c81350b5b70eb0ec812bdcd74 100644 (file)
@@ -265,7 +265,7 @@ class Profile extends BaseModule
                        $this->baseUrl->redirect('contact/' . $contact['id']);
                }
 
-               $vcard_widget  = Widget\VCard::getHTML($contact);
+               $vcard_widget   = Widget\VCard::getHTML($contact);
                $circles_widget = '';
 
                if (!in_array($localRelationship->rel, [ContactModel::NOTHING, ContactModel::SELF])) {
@@ -283,9 +283,15 @@ class Profile extends BaseModule
                ]);
 
                switch ($localRelationship->rel) {
-                       case ContactModel::FRIEND:   $relation_text = $this->t('You are mutual friends with %s', $contact['name']); break;
-                       case ContactModel::FOLLOWER:    $relation_text = $this->t('You are sharing with %s', $contact['name']); break;
-                       case ContactModel::SHARING:  $relation_text = $this->t('%s is sharing with you', $contact['name']); break;
+                       case ContactModel::FRIEND:
+                               $relation_text = $this->t('You are mutual friends with %s', $contact['name']);
+                               break;
+                       case ContactModel::FOLLOWER:
+                               $relation_text = $this->t('You are sharing with %s', $contact['name']);
+                               break;
+                       case ContactModel::SHARING:
+                               $relation_text = $this->t('%s is sharing with you', $contact['name']);
+                               break;
                        default:
                                $relation_text = '';
                }
@@ -308,8 +314,7 @@ class Profile extends BaseModule
                        $this->logger->notice('Empty gsid for contact', ['contact' => $contact]);
                }
 
-               $serverIgnored =
-                       $contact['gsid'] &&
+               $serverIgnored = $contact['gsid'] &&
                        $this->userGServer->isIgnoredByUser($this->session->getLocalUserId(), $contact['gsid']) ?
                                $this->t('This contact is on a server you ignored.')
                                : '';
@@ -475,7 +480,7 @@ class Profile extends BaseModule
 
                $hook_data = [
                        'contact' => $contact,
-                       'output' => $o,
+                       'output'  => $o,
                ];
 
                $hook_data = $this->eventDispatcher->dispatch(
index f38c0d4b3f9a64ac175e929a8a927e0cd12e81d3..ce4b8d9dd33615b4e8219b06f5be8aec1f1a3c4b 100644 (file)
@@ -31,7 +31,6 @@ use Friendica\Content\Widget\TrendingTags;
 use Friendica\Core\ACL;
 use Friendica\Core\Cache\Capability\ICanCache;
 use Friendica\Core\Config\Capability\IManageConfigValues;
-use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
index d63bbc13e3cbef4731b7aa438259edd196f35bb7..786c92dcd06cd1248042cb5d2ac7d941b8bab25a 100644 (file)
@@ -11,7 +11,6 @@ use Friendica\BaseModule;
 use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Content\Widget;
-use Friendica\Core\Hook;
 use Friendica\Core\Renderer;
 use Friendica\Core\Search;
 use Friendica\DI;
@@ -40,7 +39,7 @@ class Directory extends BaseModule
                        DI::page()['aside'] .= Widget::follow();
                }
 
-               $output = '';
+               $output  = '';
                $entries = [];
 
                Nav::setSelected('directory');
@@ -48,7 +47,7 @@ class Directory extends BaseModule
                $search = trim(rawurldecode($_REQUEST['search'] ?? ''));
 
                $gDirPath = '';
-               $dirURL = Search::getGlobalDirectory();
+               $dirURL   = Search::getGlobalDirectory();
                if (strlen($dirURL)) {
                        $gDirPath = OpenWebAuth::getZrlUrl($dirURL, true);
                }
@@ -166,7 +165,7 @@ class Directory extends BaseModule
 
                $hook_data = [
                        'contact' => $contact,
-                       'entry' => $entry,
+                       'entry'   => $entry,
                ];
 
                $hook_data = $eventDispatcher->dispatch(
index 42a46d82787d68b9b39f8bfddea537d991438ab0..64064423d7e34a7890bd45dea0b2521efc0ac472 100644 (file)
@@ -58,11 +58,11 @@ class Friendica extends BaseModule
        ) {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->config      = $config;
-               $this->keyValue    = $keyValue;
-               $this->session     = $session;
+               $this->config          = $config;
+               $this->keyValue        = $keyValue;
+               $this->session         = $session;
                $this->eventDispatcher = $eventDispatcher;
-               $this->addonHelper = $addonHelper;
+               $this->addonHelper     = $addonHelper;
        }
 
        protected function content(array $request = []): string
index 698f4256a5ac91198e6dace428c4054199b82d45..8a12d2b0a1e072250d84dbbee0b60a895d8b082b 100644 (file)
@@ -52,7 +52,7 @@ abstract class BaseUsers extends BaseModeration
        ) {
                parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->database = $database;
+               $this->database        = $database;
                $this->eventDispatcher = $eventDispatcher;
        }
 
@@ -115,7 +115,7 @@ abstract class BaseUsers extends BaseModeration
                ];
 
                $hook_data = [
-                       'tabs' => $tabs,
+                       'tabs'        => $tabs,
                        'selectedTab' => $selectedTab,
                ];
 
index 508e5d987d586d1f6354c2ea7584b6d102b3d2b8..d023368f10607d17d40e6354ff1b79c03e88e1ea 100644 (file)
@@ -31,7 +31,7 @@ class ParseUrl extends BaseModule
        {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->userSession = $userSession;
+               $this->userSession     = $userSession;
                $this->eventDispatcher = $eventDispatcher;
        }
 
@@ -41,10 +41,10 @@ class ParseUrl extends BaseModule
                        throw new \Friendica\Network\HTTPException\ForbiddenException();
                }
 
-               $format = '';
-               $title = '';
+               $format      = '';
+               $title       = '';
                $description = '';
-               $ret = ['success' => false, 'contentType' => ''];
+               $ret         = ['success' => false, 'contentType' => ''];
 
                if (!empty($_GET['binurl']) && Util\Strings::isHex($_GET['binurl'])) {
                        $url = trim(hex2bin($_GET['binurl']));
@@ -85,9 +85,9 @@ class ParseUrl extends BaseModule
                }
 
                $hook_data = [
-                       'url' => $url,
+                       'url'    => $url,
                        'format' => $format,
-                       'text' => null,
+                       'text'   => null,
                ];
 
                $hook_data = $this->eventDispatcher->dispatch(
@@ -119,14 +119,14 @@ class ParseUrl extends BaseModule
                                }
 
                                $ret['contentType'] = $content_type;
-                               $ret['data'] = ['url' => $url];
-                               $ret['success'] = true;
+                               $ret['data']        = ['url' => $url];
+                               $ret['success']     = true;
                        } else {
                                unset($siteinfo['keywords']);
 
-                               $ret['data'] = $siteinfo;
+                               $ret['data']        = $siteinfo;
                                $ret['contentType'] = 'attachment';
-                               $ret['success'] = true;
+                               $ret['success']     = true;
                        }
 
                        $this->jsonExit($ret);
index 5541a49bd630c94d5b55f5b18a2c63ba8792d0d2..e6656b95e988f2c983a105695ecf793f48ea6872 100644 (file)
@@ -58,17 +58,17 @@ class PermissionTooltip extends BaseModule
        ) {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->dba = $dba;
-               $this->aclFormatter = $aclFormatter;
-               $this->session = $session;
-               $this->config = $config;
-               $this->permissionSet = $permissionSet;
+               $this->dba             = $dba;
+               $this->aclFormatter    = $aclFormatter;
+               $this->session         = $session;
+               $this->config          = $config;
+               $this->permissionSet   = $permissionSet;
                $this->eventDispatcher = $eventDispatcher;
        }
 
        protected function rawContent(array $request = [])
        {
-               $type = $this->parameters['type'];
+               $type        = $this->parameters['type'];
                $referenceId = $this->parameters['id'];
 
                $expectedTypes = ['item', 'photo', 'event'];
@@ -79,10 +79,10 @@ class PermissionTooltip extends BaseModule
                $condition = ['id' => $referenceId, 'uid' => [0, $this->session->getLocalUserId()]];
                if ($type == 'item') {
                        $fields = ['uid', 'psid', 'private', 'uri-id', 'origin', 'network'];
-                       $model = Model\Post::selectFirst($fields, $condition, ['order' => ['uid' => true]]);
+                       $model  = Model\Post::selectFirst($fields, $condition, ['order' => ['uid' => true]]);
 
                        if ($model['origin'] || ($model['network'] != Protocol::ACTIVITYPUB)) {
-                               $permissionSet = $this->permissionSet->selectOneById($model['psid'], $model['uid']);
+                               $permissionSet      = $this->permissionSet->selectOneById($model['psid'], $model['uid']);
                                $model['allow_cid'] = $permissionSet->allow_cid;
                                $model['allow_gid'] = $permissionSet->allow_gid;
                                $model['deny_cid']  = $permissionSet->deny_cid;
@@ -94,8 +94,8 @@ class PermissionTooltip extends BaseModule
                                $model['deny_gid']  = [];
                        }
                } else {
-                       $fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
-                       $model = $this->dba->selectFirst($type, $fields, $condition);
+                       $fields             = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
+                       $model              = $this->dba->selectFirst($type, $fields, $condition);
                        $model['allow_cid'] = $this->aclFormatter->expand($model['allow_cid']);
                        $model['allow_gid'] = $this->aclFormatter->expand($model['allow_gid']);
                        $model['deny_cid']  = $this->aclFormatter->expand($model['deny_cid']);
@@ -116,7 +116,7 @@ class PermissionTooltip extends BaseModule
 
                $model = $hook_data['model'] ?? $model;
 
-               $aclReceivers = new Entity\AclReceivers();
+               $aclReceivers       = new Entity\AclReceivers();
                $addressedReceivers = new Entity\AddressedReceivers();
                if (!empty($model['allow_cid']) || !empty($model['allow_gid']) || !empty($model['deny_cid']) || !empty($model['deny_gid'])) {
                        $aclReceivers = $this->fetchReceiversFromACL($model);
@@ -126,30 +126,35 @@ class PermissionTooltip extends BaseModule
 
                $privacy = '';
                switch ($model['private'] ?? null) {
-                       case Model\Item::PUBLIC:   $privacy = $this->t('Public'); break;
-                       case Model\Item::UNLISTED: $privacy = $this->t('Unlisted'); break;
-                       case Model\Item::PRIVATE:  $privacy = $this->t('Limited/Private'); break;
+                       case Model\Item::PUBLIC:
+                               $privacy = $this->t('Public');
+                               break;
+                       case Model\Item::UNLISTED:
+                               $privacy = $this->t('Unlisted');
+                               break;
+                       case Model\Item::PRIVATE:
+                               $privacy = $this->t('Limited/Private');
+                               break;
                }
 
-               if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy))
-               {
+               if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy)) {
                        echo $this->t('Remote privacy information not available.');
                        exit;
                }
 
-               $tpl = Renderer::getMarkupTemplate('privacy/permission_tooltip.tpl');
+               $tpl    = Renderer::getMarkupTemplate('privacy/permission_tooltip.tpl');
                $output = Renderer::replaceMacros($tpl, [
                        '$l10n' => [
                                'visible_to' => $this->t('Visible to:'),
-                               'to' => $this->t('To:'),
-                               'cc' => $this->t('CC:'),
-                               'bcc' => $this->t('BCC:'),
-                               'audience' => $this->t('Audience:'),
+                               'to'         => $this->t('To:'),
+                               'cc'         => $this->t('CC:'),
+                               'bcc'        => $this->t('BCC:'),
+                               'audience'   => $this->t('Audience:'),
                                'attributed' => $this->t('Attributed To:'),
                        ],
-                       '$aclReceivers' => $aclReceivers,
+                       '$aclReceivers'       => $aclReceivers,
                        '$addressedReceivers' => $addressedReceivers,
-                       '$privacy' => $privacy,
+                       '$privacy'            => $privacy,
                ]);
 
                $this->httpExit($output);
@@ -223,7 +228,7 @@ class PermissionTooltip extends BaseModule
        private function fetchAddressedReceivers(int $uriId): Entity\AddressedReceivers
        {
                $own_url = '';
-               $uid = $this->session->getLocalUserId();
+               $uid     = $this->session->getLocalUserId();
                if ($uid) {
                        $owner = Model\User::getOwnerDataById($uid);
                        if (!empty($owner['url'])) {
@@ -246,11 +251,11 @@ class PermissionTooltip extends BaseModule
                                        $receivers[$receiver['type']][] = $this->t('Collection (%s)', $receiver['name']);
                                        break;
                                case Model\Tag::FOLLOWER_COLLECTION:
-                                       $apcontact = $this->dba->selectFirst('apcontact', ['name'], ['followers' => $receiver['url']]);
+                                       $apcontact                      = $this->dba->selectFirst('apcontact', ['name'], ['followers' => $receiver['url']]);
                                        $receivers[$receiver['type']][] = $this->t('Followers (%s)', $apcontact['name'] ?? $receiver['name']);
                                        break;
                                case Model\Tag::ACCOUNT:
-                                       $apcontact = Model\APContact::getByURL($receiver['url'], false);
+                                       $apcontact                      = Model\APContact::getByURL($receiver['url'], false);
                                        $receivers[$receiver['type']][] = $apcontact['name'] ?? $receiver['name'];
                                        break;
                                default:
@@ -260,19 +265,19 @@ class PermissionTooltip extends BaseModule
                }
 
                foreach ($receivers as $type => $receiver) {
-                       $max = $this->config->get('system', 'max_receivers');
+                       $max   = $this->config->get('system', 'max_receivers');
                        $total = count($receiver);
                        if ($total > $max) {
-                               $receivers[$type] = array_slice($receiver, 0, $max);
+                               $receivers[$type]   = array_slice($receiver, 0, $max);
                                $receivers[$type][] = $this->t('%d more', $total - $max);
                        }
                }
 
                return new Entity\AddressedReceivers(
-                       $receivers[Model\Tag::TO] ?? [],
-                       $receivers[Model\Tag::CC] ?? [],
-                       $receivers[Model\Tag::BCC] ?? [],
-                       $receivers[Model\Tag::AUDIENCE] ?? [],
+                       $receivers[Model\Tag::TO]         ?? [],
+                       $receivers[Model\Tag::CC]         ?? [],
+                       $receivers[Model\Tag::BCC]        ?? [],
+                       $receivers[Model\Tag::AUDIENCE]   ?? [],
                        $receivers[Model\Tag::ATTRIBUTED] ?? [],
                );
        }
index 2c543f94493bf45f4a8b4f58ab0a5fe20ba0a4a9..6d9bca26e34ced26d5a280e15e6082aaa03b710d 100644 (file)
@@ -77,13 +77,13 @@ class Photos extends \Friendica\Module\BaseProfile
        ) {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->session        = $session;
-               $this->page           = $page;
-               $this->config         = $config;
-               $this->appHelper      = $appHelper;
-               $this->database       = $database;
-               $this->systemMessages = $systemMessages;
-               $this->aclFormatter   = $aclFormatter;
+               $this->session         = $session;
+               $this->page            = $page;
+               $this->config          = $config;
+               $this->appHelper       = $appHelper;
+               $this->database        = $database;
+               $this->systemMessages  = $systemMessages;
+               $this->aclFormatter    = $aclFormatter;
                $this->eventDispatcher = $eventDispatcher;
 
                $owner = Profile::load($this->appHelper, $this->parameters['nickname'] ?? '', false);
@@ -109,7 +109,7 @@ class Photos extends \Friendica\Module\BaseProfile
                if ($visibility === 'public') {
                        // The ACL selector introduced in version 2019.12 sends ACL input data even when the Public visibility is selected
                        $str_contact_allow = $str_circle_allow = $str_contact_deny = $str_circle_deny = '';
-               } else if ($visibility === 'custom') {
+               } elseif ($visibility === 'custom') {
                        // Since we know from the visibility parameter the item should be private, we have to prevent the empty ACL
                        // case that would make it public. So we always append the author's contact id to the allowed contacts.
                        // See https://github.com/friendica/friendica/issues/9672
@@ -155,10 +155,10 @@ class Photos extends \Friendica\Module\BaseProfile
                }
 
                $hook_data = [
-                       'src' => '',
+                       'src'      => '',
                        'filename' => '',
                        'filesize' => 0,
-                       'type' => '',
+                       'type'     => '',
                ];
 
                $hook_data = $this->eventDispatcher->dispatch(
@@ -183,7 +183,7 @@ class Photos extends \Friendica\Module\BaseProfile
                        $type     = $_FILES['userfile']['type'];
                        $error    = $_FILES['userfile']['error'];
                } else {
-                       $error    = UPLOAD_ERR_NO_FILE;
+                       $error = UPLOAD_ERR_NO_FILE;
                }
 
                if ($error !== UPLOAD_ERR_OK) {
@@ -314,7 +314,7 @@ class Photos extends \Friendica\Module\BaseProfile
                $arr['visible']       = $visible;
                $arr['origin']        = 1;
 
-               $arr['body']          = Images::getBBCodeByResource($resource_id, $this->owner['nickname'], $preview, $image->getExt());
+               $arr['body'] = Images::getBBCodeByResource($resource_id, $this->owner['nickname'], $preview, $image->getExt());
 
                $item_id = Item::insert($arr);
                // Update the photo albums cache
@@ -383,7 +383,7 @@ class Photos extends \Friendica\Module\BaseProfile
                        $pager->getItemsPerPage()
                ));
 
-               $photos = array_map(function ($photo){
+               $photos = array_map(function ($photo) {
                        return [
                                'id'    => $photo['id'],
                                'link'  => 'photos/' . $this->owner['nickname'] . '/image/' . $photo['resource-id'],
index cb75b2fecc61f426deb27b6cc29d78180b1d2dcb..58f829907e55a536f82e193ab5b69ba3b62db734 100644 (file)
@@ -78,12 +78,12 @@ class Profile extends BaseProfile
        ) {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->database     = $database;
-               $this->appHelper    = $appHelper;
-               $this->session      = $session;
-               $this->config       = $config;
-               $this->page         = $page;
-               $this->profileField = $profileField;
+               $this->database        = $database;
+               $this->appHelper       = $appHelper;
+               $this->session         = $session;
+               $this->config          = $config;
+               $this->page            = $page;
+               $this->profileField    = $profileField;
                $this->eventDispatcher = $eventDispatcher;
        }
 
@@ -273,7 +273,7 @@ class Profile extends BaseProfile
                }
 
                $tpl = Renderer::getMarkupTemplate('profile/profile.tpl');
-               $o   .= Renderer::replaceMacros($tpl, [
+               $o .= Renderer::replaceMacros($tpl, [
                        '$title'                 => $this->t('Profile'),
                        '$yourself'              => $this->t('Yourself'),
                        '$view_as_contacts'      => $view_as_contacts,
@@ -293,7 +293,7 @@ class Profile extends BaseProfile
                                'title' => '',
                                'label' => $this->t('Edit profile')
                        ],
-                       '$viewas_link'           => [
+                       '$viewas_link' => [
                                'url'   => $this->args->getQueryString() . '#viewas',
                                'title' => '',
                                'label' => $this->t('View as')
@@ -362,7 +362,7 @@ class Profile extends BaseProfile
                $htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/" title="' . $this->t('%s\'s posts', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
                $htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/comments" title="' . $this->t('%s\'s comments', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
                $htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/activity" title="' . $this->t('%s\'s timeline', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
-               $uri      = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''));
+               $uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''));
                $htmlhead .= '<link rel="lrdd" type="application/xrd+xml" href="' . $this->baseUrl . '/xrd/?uri=' . $uri . '" />' . "\n";
                header('Link: <' . $this->baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
 
index 6f641355e38895c85eca3614d4552eada01aa2c2..39ec42cd84c66605d6281ac13995860c70ef9f7b 100644 (file)
@@ -50,7 +50,7 @@ class Register extends BaseModule
 
                $this->tos = new Tos($l10n, $baseUrl, $args, $logger, $profiler, $response, $config, $server, $parameters);
 
-               $this->session = $session;
+               $this->session         = $session;
                $this->eventDispatcher = $eventDispatcher;
        }
 
index 3419672b1937da521cf53dc469086397b805a245..410bae9a5e0baa5364337bde769c44a77ec324d7 100644 (file)
@@ -62,8 +62,8 @@ class Acl extends BaseModule
        ) {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               $this->session  = $session;
-               $this->database = $database;
+               $this->session         = $session;
+               $this->database        = $database;
                $this->eventDispatcher = $eventDispatcher;
        }
 
@@ -118,9 +118,9 @@ class Acl extends BaseModule
 
        private function regularContactSearch(array $request, string $type): array
        {
-               $start   = $request['start'] ?? 0;
-               $count   = $request['count'] ?? 100;
-               $search  = $request['search'] ?? '';
+               $start   = $request['start']        ?? 0;
+               $count   = $request['count']        ?? 100;
+               $search  = $request['search']       ?? '';
                $conv_id = $request['conversation'] ?? null;
 
                // For use with jquery.textcomplete for private mail completion
@@ -138,9 +138,9 @@ class Acl extends BaseModule
                $condition_circle = ["`uid` = ? AND NOT `deleted`", $this->session->getLocalUserId()];
 
                if ($search != '') {
-                       $sql_extra        = "AND `name` LIKE '%%" . $this->database->escape($search) . "%%'";
-                       $condition        = DBA::mergeConditions($condition, ["(`attag` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)",
-                                                                            '%' . $search . '%', '%' . $search . '%', '%' . $search . '%']);
+                       $sql_extra = "AND `name` LIKE '%%" . $this->database->escape($search) . "%%'";
+                       $condition = DBA::mergeConditions($condition, ["(`attag` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)",
+                               '%' . $search . '%', '%' . $search . '%', '%' . $search . '%']);
                        $condition_circle = DBA::mergeConditions($condition_circle, ["`name` LIKE ?", '%' . $search . '%']);
                }
 
@@ -156,21 +156,27 @@ class Acl extends BaseModule
                switch ($type) {
                        case self::TYPE_MENTION_CONTACT_CIRCLE:
                        case self::TYPE_MENTION_CONTACT:
-                               $condition = DBA::mergeConditions($condition,
+                               $condition = DBA::mergeConditions(
+                                       $condition,
                                        ["NOT `self` AND NOT `blocked`",
-                                       ]);
+                                       ]
+                               );
                                break;
 
                        case self::TYPE_MENTION_GROUP:
-                               $condition = DBA::mergeConditions($condition,
+                               $condition = DBA::mergeConditions(
+                                       $condition,
                                        ["NOT `self` AND NOT `blocked` AND (NOT `ap-posting-restricted` OR `ap-posting-restricted` IS NULL) AND `contact-type` = ?", Contact::TYPE_COMMUNITY
-                                       ]);
+                                       ]
+                               );
                                break;
 
                        case self::TYPE_PRIVATE_MESSAGE:
-                               $condition = DBA::mergeConditions($condition,
+                               $condition = DBA::mergeConditions(
+                                       $condition,
                                        ["NOT `self` AND NOT `blocked` AND `network` IN (?, ?, ?)", Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA
-                                       ]);
+                                       ]
+                               );
                                break;
                }
 
@@ -184,7 +190,8 @@ class Acl extends BaseModule
                if ($type == self::TYPE_MENTION_CONTACT_CIRCLE || $type == self::TYPE_MENTION_CIRCLE) {
                        /// @todo We should cache this query.
                        // This can be done when we can delete cache entries via wildcard
-                       $circles = $this->database->toArray($this->database->p("SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids
+                       $circles = $this->database->toArray($this->database->p(
+                               "SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids
                                FROM `group` AS `circle`
                                INNER JOIN `group_member` AS `circle_member` ON `circle_member`.`gid` = `circle`.`id`
                                WHERE NOT `circle`.`deleted` AND `circle`.`uid` = ?
index 7b05aceaa62699fb468690cb4aa088feda0209c5..6f7a3a6204e6cf593cc046d2d6a8616a3c64b67d 100644 (file)
@@ -111,7 +111,7 @@ class Index extends BaseSettings
 
                        if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
                                $ignore_year = true;
-                               $dob = substr($dob, 5);
+                               $dob         = substr($dob, 5);
                        }
 
                        if ($ignore_year) {
@@ -245,7 +245,7 @@ class Index extends BaseSettings
                                        $this->session->getLocalUserId(),
                                        false,
                                        ['allow_cid' => []],
-                                       ['network' => Protocol::DFRN],
+                                       ['network'   => Protocol::DFRN],
                                        'profile_field[new]'
                                ),
                        ],
@@ -278,7 +278,8 @@ class Index extends BaseSettings
                                'miscellaneous_section'     => $this->t('Miscellaneous'),
                                'custom_fields_section'     => $this->t('Custom Profile Fields'),
                                'profile_photo'             => $this->t('Upload Profile Photo'),
-                               'custom_fields_description' => $this->t('<p>Custom fields appear on <a href="%s">your profile page</a>.</p>
+                               'custom_fields_description' => $this->t(
+                                       '<p>Custom fields appear on <a href="%s">your profile page</a>.</p>
                                <p>You can use BBCodes in the field values.</p>
                                <p>Reorder by dragging the field title.</p>
                                <p>Empty the label field to remove a custom field.</p>
@@ -314,7 +315,7 @@ class Index extends BaseSettings
 
                $hook_data = [
                        'profile' => $owner,
-                       'entry' => $o,
+                       'entry'   => $o,
                ];
 
                $hook_data = $this->eventDispatcher->dispatch(
index 17d3e81c446148f634af4641cbd986d7febd2e1d..40caa2943754f70a15642815df03129e843bcbcf 100644 (file)
@@ -74,12 +74,12 @@ class Notify extends BaseRepository
                EventDispatcherInterface $eventDispatcher,
                Factory\Notify $factory = null
        ) {
-               $this->l10n         = $l10n;
-               $this->baseUrl      = $baseUrl;
-               $this->config       = $config;
-               $this->pConfig      = $pConfig;
-               $this->emailer      = $emailer;
-               $this->notification = $notification;
+               $this->l10n            = $l10n;
+               $this->baseUrl         = $baseUrl;
+               $this->config          = $config;
+               $this->pConfig         = $pConfig;
+               $this->emailer         = $emailer;
+               $this->notification    = $notification;
                $this->eventDispatcher = $eventDispatcher;
 
                parent::__construct($database, $logger, $factory ?? new Factory\Notify($logger));
index 14aa41f5a4294fdc20c39b167dd4d2b48ff3b6eb..8af22c4b78baa85f3e955db7b280234a91a20b55 100644 (file)
@@ -376,7 +376,7 @@ class StorageManagerTest extends DatabaseTestCase
                        $this->l10n,
                        false
                );
-               $storage        = $storageManager->getWritableStorageByName($name);
+               $storage = $storageManager->getWritableStorageByName($name);
                $storageManager->move($storage);
 
                $photos = $this->database->select('photo', ['backend-ref', 'backend-class', 'id', 'data']);
@@ -407,7 +407,7 @@ class StorageManagerTest extends DatabaseTestCase
                        $this->l10n,
                        false
                );
-               $storage        = $storageManager->getWritableStorageByName(SystemResource::getName());
+               $storage = $storageManager->getWritableStorageByName(SystemResource::getName());
                $storageManager->move($storage);
        }
 }