From e1625363947b66346382f5606e2e00ec9c1ac2b7 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Tue, 2 Apr 2024 14:16:03 +0200 Subject: [PATCH] fixup! chore(deps-dev): bump nextcloud/coding-standard from 1.0.0 to 1.2.1 Signed-off-by: Hamza Mahjoubi --- .../Providers/DetailsProvider.php | 6 ++--- lib/Controller/ContactsController.php | 4 ++-- lib/Controller/PageController.php | 20 ++++++++--------- lib/Controller/SocialApiController.php | 6 ++--- lib/Cron/SocialUpdate.php | 6 ++--- lib/Cron/SocialUpdateRegistration.php | 10 ++++----- .../Social/CompositeSocialProvider.php | 14 ++++++------ lib/Service/Social/InstagramProvider.php | 2 +- lib/Service/Social/MastodonProvider.php | 2 +- lib/Service/Social/TelegramProvider.php | 2 +- lib/Service/SocialApiService.php | 22 +++++++++---------- .../Controller/ContactsControllerTest.php | 6 ++--- .../Service/Social/DiasporaProviderTest.php | 4 ++-- .../Service/Social/FacebookProviderTest.php | 4 ++-- .../Service/Social/InstagramProviderTest.php | 6 ++--- .../Service/Social/MastodonProviderTest.php | 4 ++-- .../Service/Social/TelegramProviderTest.php | 4 ++-- .../unit/Service/Social/XingProviderTest.php | 4 ++-- tests/unit/Service/SocialApiServiceTest.php | 18 +++++++-------- 19 files changed, 72 insertions(+), 72 deletions(-) diff --git a/lib/ContactsMenu/Providers/DetailsProvider.php b/lib/ContactsMenu/Providers/DetailsProvider.php index 6988edb9de..5f949ae43b 100644 --- a/lib/ContactsMenu/Providers/DetailsProvider.php +++ b/lib/ContactsMenu/Providers/DetailsProvider.php @@ -49,9 +49,9 @@ class DetailsProvider implements IProvider { * @param IActionFactory $actionFactory */ public function __construct(IURLGenerator $urlGenerator, - IActionFactory $actionFactory, - IL10N $l10n, - IManager $manager) { + IActionFactory $actionFactory, + IL10N $l10n, + IManager $manager) { $this->actionFactory = $actionFactory; $this->urlGenerator = $urlGenerator; $this->l10n = $l10n; diff --git a/lib/Controller/ContactsController.php b/lib/Controller/ContactsController.php index 7b42e5ac3d..6deffb7743 100644 --- a/lib/Controller/ContactsController.php +++ b/lib/Controller/ContactsController.php @@ -38,8 +38,8 @@ class ContactsController extends Controller { private $urlGenerator; public function __construct(IRequest $request, - IL10N $l10n, - IURLGenerator $urlGenerator) { + IL10N $l10n, + IURLGenerator $urlGenerator) { parent::__construct(Application::APP_ID, $request); $this->l10n = $l10n; diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 6680d00001..0d052ad6e1 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -25,12 +25,12 @@ namespace OCA\Contacts\Controller; use OC\App\CompareVersion; +use OCA\Contacts\AppInfo\Application; +use OCA\Contacts\Service\SocialApiService; use OCP\App\IAppManager; + use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; - -use OCA\Contacts\AppInfo\Application; -use OCA\Contacts\Service\SocialApiService; use OCP\IConfig; use OCP\IInitialStateService; use OCP\IRequest; @@ -61,13 +61,13 @@ class PageController extends Controller { private $compareVersion; public function __construct(IRequest $request, - IConfig $config, - IInitialStateService $initialStateService, - IFactory $languageFactory, - IUserSession $userSession, - SocialApiService $socialApiService, - IAppManager $appManager, - CompareVersion $compareVersion) { + IConfig $config, + IInitialStateService $initialStateService, + IFactory $languageFactory, + IUserSession $userSession, + SocialApiService $socialApiService, + IAppManager $appManager, + CompareVersion $compareVersion) { parent::__construct(Application::APP_ID, $request); $this->config = $config; diff --git a/lib/Controller/SocialApiController.php b/lib/Controller/SocialApiController.php index b09eafdb79..9849ca9c55 100644 --- a/lib/Controller/SocialApiController.php +++ b/lib/Controller/SocialApiController.php @@ -45,9 +45,9 @@ class SocialApiController extends ApiController { private $socialApiService; public function __construct(IRequest $request, - IConfig $config, - IUserSession $userSession, - SocialApiService $socialApiService) { + IConfig $config, + IUserSession $userSession, + SocialApiService $socialApiService) { parent::__construct(Application::APP_ID, $request); $this->config = $config; diff --git a/lib/Cron/SocialUpdate.php b/lib/Cron/SocialUpdate.php index 4c0bd8e6d2..feb5376f8e 100644 --- a/lib/Cron/SocialUpdate.php +++ b/lib/Cron/SocialUpdate.php @@ -43,9 +43,9 @@ class SocialUpdate extends QueuedJob { private $userManager; public function __construct(ITimeFactory $time, - SocialApiService $social, - IJobList $jobList, - IUserManager $userManager) { + SocialApiService $social, + IJobList $jobList, + IUserManager $userManager) { parent::__construct($time); $this->social = $social; $this->jobList = $jobList; diff --git a/lib/Cron/SocialUpdateRegistration.php b/lib/Cron/SocialUpdateRegistration.php index 72e4c8874b..ba19c55857 100644 --- a/lib/Cron/SocialUpdateRegistration.php +++ b/lib/Cron/SocialUpdateRegistration.php @@ -33,8 +33,8 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\TimedJob; -use OCP\IUser; use OCP\IConfig; +use OCP\IUser; use OCP\IUserManager; use function method_exists; @@ -58,10 +58,10 @@ class SocialUpdateRegistration extends TimedJob { * @param IJobList $jobList */ public function __construct( - ITimeFactory $time, - IUserManager $userManager, - IConfig $config, - IJobList $jobList) { + ITimeFactory $time, + IUserManager $userManager, + IConfig $config, + IJobList $jobList) { parent::__construct($time); $this->appName = Application::APP_ID; diff --git a/lib/Service/Social/CompositeSocialProvider.php b/lib/Service/Social/CompositeSocialProvider.php index 7ca3f38853..0f1d98e5b4 100644 --- a/lib/Service/Social/CompositeSocialProvider.php +++ b/lib/Service/Social/CompositeSocialProvider.php @@ -31,13 +31,13 @@ class CompositeSocialProvider { private $providers; public function __construct(InstagramProvider $instagramProvider, - MastodonProvider $mastodonProvider, - // FacebookProvider $facebookProvider, - TumblrProvider $tumblrProvider, - DiasporaProvider $diasporaProvider, - XingProvider $xingProvider, - TelegramProvider $telegramProvider, - GravatarProvider $gravatarProvider) { + MastodonProvider $mastodonProvider, + // FacebookProvider $facebookProvider, + TumblrProvider $tumblrProvider, + DiasporaProvider $diasporaProvider, + XingProvider $xingProvider, + TelegramProvider $telegramProvider, + GravatarProvider $gravatarProvider) { // This determines the priority of known providers $this->providers = [ $instagramProvider->name => $instagramProvider, diff --git a/lib/Service/Social/InstagramProvider.php b/lib/Service/Social/InstagramProvider.php index 1b046f8711..0b30ce7769 100644 --- a/lib/Service/Social/InstagramProvider.php +++ b/lib/Service/Social/InstagramProvider.php @@ -42,7 +42,7 @@ class InstagramProvider implements ISocialProvider { public $name = 'instagram'; public function __construct(IClientService $httpClient, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->httpClient = $httpClient->newClient(); $this->logger = $logger; } diff --git a/lib/Service/Social/MastodonProvider.php b/lib/Service/Social/MastodonProvider.php index b4b71924b9..b81f0686a1 100644 --- a/lib/Service/Social/MastodonProvider.php +++ b/lib/Service/Social/MastodonProvider.php @@ -150,7 +150,7 @@ protected function cleanupId(string $candidate):?array { } $masto_user = trim($masto_user, '/'); $masto_server = trim($masto_server, '/'); - return array($masto_user, $masto_server); + return [$masto_user, $masto_server]; } catch (\Exception $e) { return null; } diff --git a/lib/Service/Social/TelegramProvider.php b/lib/Service/Social/TelegramProvider.php index 56bb6f5057..c15b0a5acc 100644 --- a/lib/Service/Social/TelegramProvider.php +++ b/lib/Service/Social/TelegramProvider.php @@ -41,7 +41,7 @@ class TelegramProvider implements ISocialProvider { public $name = 'telegram'; public function __construct(IClientService $httpClient, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->httpClient = $httpClient->newClient(); $this->logger = $logger; } diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php index 1c6e482792..2ff7d67fa4 100644 --- a/lib/Service/SocialApiService.php +++ b/lib/Service/SocialApiService.php @@ -64,15 +64,15 @@ class SocialApiService { private $imageResizer; public function __construct( - CompositeSocialProvider $socialProvider, - IManager $manager, - IConfig $config, - IClientService $clientService, - IL10N $l10n, - IURLGenerator $urlGen, - CardDavBackend $davBackend, - ITimeFactory $timeFactory, - ImageResizer $imageResizer) { + CompositeSocialProvider $socialProvider, + IManager $manager, + IConfig $config, + IClientService $clientService, + IL10N $l10n, + IURLGenerator $urlGen, + CardDavBackend $davBackend, + ITimeFactory $timeFactory, + ImageResizer $imageResizer) { $this->appName = Application::APP_ID; $this->socialProvider = $socialProvider; $this->manager = $manager; @@ -136,7 +136,7 @@ protected function addPhoto(array &$contact, string $imageType, string $photo) { * * @returns {IAddressBook} the corresponding addressbook or null */ - protected function getAddressBook(string $addressbookId, IManager $manager = null) : ?IAddressBook { + protected function getAddressBook(string $addressbookId, ?IManager $manager = null) : ?IAddressBook { $addressBook = null; if ($manager === null) { $manager = $this->manager; @@ -367,7 +367,7 @@ protected function sortContacts(array $a, array $b) { * * @returns {JSONResponse} JSONResponse with the list of changed and failed contacts */ - public function updateAddressbooks(string $userId, string $offsetBook = null, string $offsetContact = null, string $network = null) : JSONResponse { + public function updateAddressbooks(string $userId, ?string $offsetBook = null, ?string $offsetContact = null, ?string $network = null) : JSONResponse { // double check! $syncAllowedByAdmin = $this->config->getAppValue($this->appName, 'allowSocialSync', 'yes'); $bgSyncEnabledByUser = $this->config->getUserValue($userId, $this->appName, 'enableSocialSync', 'no'); diff --git a/tests/unit/Controller/ContactsControllerTest.php b/tests/unit/Controller/ContactsControllerTest.php index e618bba992..9265ccc057 100644 --- a/tests/unit/Controller/ContactsControllerTest.php +++ b/tests/unit/Controller/ContactsControllerTest.php @@ -23,12 +23,12 @@ namespace OCA\Contacts\Controller; -use PHPUnit\Framework\MockObject\MockObject; +use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\AppFramework\Http\RedirectResponse; use OCP\IL10N; use OCP\IRequest; use OCP\IURLGenerator; -use ChristophWurst\Nextcloud\Testing\TestCase; -use OCP\AppFramework\Http\RedirectResponse; +use PHPUnit\Framework\MockObject\MockObject; class ContactsControllerTest extends TestCase { private $controller; diff --git a/tests/unit/Service/Social/DiasporaProviderTest.php b/tests/unit/Service/Social/DiasporaProviderTest.php index e236139588..508fb59924 100644 --- a/tests/unit/Service/Social/DiasporaProviderTest.php +++ b/tests/unit/Service/Social/DiasporaProviderTest.php @@ -24,10 +24,10 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; class DiasporaProviderTest extends TestCase { diff --git a/tests/unit/Service/Social/FacebookProviderTest.php b/tests/unit/Service/Social/FacebookProviderTest.php index 2537bd3b4d..3131a4f981 100644 --- a/tests/unit/Service/Social/FacebookProviderTest.php +++ b/tests/unit/Service/Social/FacebookProviderTest.php @@ -24,10 +24,10 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; class FacebookProviderTest extends TestCase { diff --git a/tests/unit/Service/Social/InstagramProviderTest.php b/tests/unit/Service/Social/InstagramProviderTest.php index cba8de9191..77bcd5c92e 100644 --- a/tests/unit/Service/Social/InstagramProviderTest.php +++ b/tests/unit/Service/Social/InstagramProviderTest.php @@ -24,12 +24,12 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use Psr\Log\LoggerInterface; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class InstagramProviderTest extends TestCase { private $provider; diff --git a/tests/unit/Service/Social/MastodonProviderTest.php b/tests/unit/Service/Social/MastodonProviderTest.php index 802364d15f..3a9cf06469 100644 --- a/tests/unit/Service/Social/MastodonProviderTest.php +++ b/tests/unit/Service/Social/MastodonProviderTest.php @@ -24,10 +24,10 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; class MastodonProviderTest extends TestCase { diff --git a/tests/unit/Service/Social/TelegramProviderTest.php b/tests/unit/Service/Social/TelegramProviderTest.php index 666158bbbc..3b0dded5e9 100644 --- a/tests/unit/Service/Social/TelegramProviderTest.php +++ b/tests/unit/Service/Social/TelegramProviderTest.php @@ -24,10 +24,10 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; diff --git a/tests/unit/Service/Social/XingProviderTest.php b/tests/unit/Service/Social/XingProviderTest.php index e5d94ee6cd..cf0badaba4 100644 --- a/tests/unit/Service/Social/XingProviderTest.php +++ b/tests/unit/Service/Social/XingProviderTest.php @@ -24,10 +24,10 @@ namespace OCA\Contacts\Service\Social; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use ChristophWurst\Nextcloud\Testing\TestCase; +use OCP\Http\Client\IResponse; use PHPUnit\Framework\MockObject\MockObject; class XingProviderTest extends TestCase { diff --git a/tests/unit/Service/SocialApiServiceTest.php b/tests/unit/Service/SocialApiServiceTest.php index 0bee78bded..1e1ed31392 100644 --- a/tests/unit/Service/SocialApiServiceTest.php +++ b/tests/unit/Service/SocialApiServiceTest.php @@ -24,24 +24,24 @@ namespace OCA\Contacts\Service; +use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Contacts\Service\Social\CompositeSocialProvider; -use OCA\Contacts\Service\Social\ISocialProvider; +use OCA\Contacts\Service\Social\ISocialProvider; +use OCA\DAV\CardDAV\CardDavBackend; use OCP\AppFramework\Http; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Contacts\IManager; use OCP\Http\Client\IClient; -use OCP\Http\Client\IResponse; use OCP\Http\Client\IClientService; -use OCP\IConfig; -use OCP\Contacts\IManager; +use OCP\Http\Client\IResponse; use OCP\IAddressBook; -use OCA\DAV\CardDAV\CardDavBackend; -use OCP\IURLGenerator; +use OCP\IConfig; use OCP\IL10N; -use OCP\Util; -use OCP\AppFramework\Utility\ITimeFactory; +use OCP\IURLGenerator; +use OCP\Util; use PHPUnit\Framework\MockObject\MockObject; -use ChristophWurst\Nextcloud\Testing\TestCase; class SocialApiServiceTest extends TestCase { private SocialApiService $service;