Skip to content

Commit

Permalink
run composer cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Apr 2, 2024
1 parent 21c1825 commit b173ba7
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 72 deletions.
6 changes: 3 additions & 3 deletions lib/ContactsMenu/Providers/DetailsProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/SocialApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/Cron/SocialUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions lib/Cron/SocialUpdateRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions lib/Service/Social/CompositeSocialProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Social/InstagramProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Social/MastodonProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Social/TelegramProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 11 additions & 11 deletions lib/Service/SocialApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Controller/ContactsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Service/Social/DiasporaProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Service/Social/FacebookProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Service/Social/InstagramProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Service/Social/MastodonProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Service/Social/TelegramProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Service/Social/XingProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/Service/SocialApiServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b173ba7

Please sign in to comment.