run composer cs:fix

Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
This commit is contained in:
Hamza Mahjoubi 2024-04-02 14:16:03 +02:00
parent 21c1825787
commit b173ba79eb
19 changed files with 87 additions and 87 deletions

View File

@ -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;

View File

@ -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;

View File

@ -25,12 +25,12 @@
namespace OCA\Contacts\Controller;
use OC\App\CompareVersion;
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\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
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;

View File

@ -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;

View File

@ -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;

View File

@ -33,8 +33,8 @@ use OCA\Contacts\AppInfo\Application;
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;

View File

@ -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,

View File

@ -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;
}

View File

@ -150,7 +150,7 @@ class MastodonProvider implements ISocialProvider {
}
$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;
}

View File

@ -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;
}

View File

@ -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 @@ class SocialApiService {
*
* @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 @@ class SocialApiService {
*
* @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');

View File

@ -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;

View File

@ -24,10 +24,10 @@
namespace OCA\Contacts\Service\Social;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
class DiasporaProviderTest extends TestCase {

View File

@ -24,10 +24,10 @@
namespace OCA\Contacts\Service\Social;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
class FacebookProviderTest extends TestCase {

View File

@ -24,12 +24,12 @@
namespace OCA\Contacts\Service\Social;
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\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
class InstagramProviderTest extends TestCase {
private $provider;

View File

@ -24,10 +24,10 @@
namespace OCA\Contacts\Service\Social;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
class MastodonProviderTest extends TestCase {

View File

@ -24,10 +24,10 @@
namespace OCA\Contacts\Service\Social;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;

View File

@ -24,10 +24,10 @@
namespace OCA\Contacts\Service\Social;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use PHPUnit\Framework\MockObject\MockObject;
class XingProviderTest extends TestCase {

View File

@ -24,24 +24,24 @@
namespace OCA\Contacts\Service;
use OCA\Contacts\Service\Social\CompositeSocialProvider;
use OCA\Contacts\Service\Social\ISocialProvider;
use OCP\AppFramework\Http;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\Contacts\IManager;
use OCP\IAddressBook;
use OCA\DAV\CardDAV\CardDavBackend;
use OCP\IURLGenerator;
use OCP\IL10N;
use OCP\Util;
use OCP\AppFramework\Utility\ITimeFactory;
use PHPUnit\Framework\MockObject\MockObject;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Contacts\Service\Social\CompositeSocialProvider;
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\IClientService;
use OCP\Http\Client\IResponse;
use OCP\IAddressBook;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Util;
use PHPUnit\Framework\MockObject\MockObject;
class SocialApiServiceTest extends TestCase {
private SocialApiService $service;