Skip to content

Commit 11fa50a

Browse files
chore: apply rector
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent 22913ca commit 11fa50a

10 files changed

Lines changed: 22 additions & 32 deletions

lib/Cron/SocialUpdateRegistration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use OCP\IUserManager;
2020

2121
class SocialUpdateRegistration extends TimedJob {
22-
private $appName;
22+
private string $appName;
2323

2424
/**
2525
* RegisterSocialUpdate constructor.

lib/Dav/PatchPlugin.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Sabre\CardDAV\Card;
1313
use Sabre\DAV;
14+
use Sabre\DAV\Exception\BadRequest;
1415
use Sabre\DAV\Server;
1516
use Sabre\DAV\ServerPlugin;
1617
use Sabre\HTTP\RequestInterface;
@@ -91,7 +92,7 @@ public function httpPatch(RequestInterface $request, ResponseInterface $response
9192
// Init property name & value
9293
$propertyName = $request->getHeader('X-Property');
9394
if (is_null($propertyName)) {
94-
throw new DAV\Exception\BadRequest('No valid "X-Property" found in the headers');
95+
throw new BadRequest('No valid "X-Property" found in the headers');
9596
}
9697

9798
$propertyData = $request->getHeader('X-Property-Replace');
@@ -100,7 +101,7 @@ public function httpPatch(RequestInterface $request, ResponseInterface $response
100101
$propertyData = $request->getHeader('X-Property-Append');
101102
$method = self::METHOD_APPEND;
102103
if (is_null($propertyData)) {
103-
throw new DAV\Exception\BadRequest('No valid "X-Property-Append" or "X-Property-Replace" found in the headers');
104+
throw new BadRequest('No valid "X-Property-Append" or "X-Property-Replace" found in the headers');
104105
}
105106
}
106107

@@ -112,7 +113,7 @@ public function httpPatch(RequestInterface $request, ResponseInterface $response
112113

113114
// We cannot know which one to update in that case
114115
if (count($properties) > 1) {
115-
throw new DAV\Exception\BadRequest('The specified property appear more than once');
116+
throw new BadRequest('The specified property appear more than once');
116117
}
117118

118119
// Init if not in the vcard

lib/Service/Social/CompositeSocialProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class CompositeSocialProvider {
1414
/** @var ISocialProvider[] */
15-
private $providers;
15+
private array $providers;
1616

1717
public function __construct(InstagramProvider $instagramProvider,
1818
MastodonProvider $mastodonProvider,

lib/Service/Social/DiasporaProvider.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
use OCP\Http\Client\IClientService;
1212

1313
class DiasporaProvider implements ISocialProvider {
14-
/** @var IClient */
15-
private $httpClient;
14+
private IClient $httpClient;
1615

17-
/** @var bool */
18-
private $looping;
16+
private bool $looping;
1917

2018
/** @var string */
2119
public $name = 'diaspora';

lib/Service/Social/FacebookProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use OCP\Http\Client\IClientService;
1212

1313
class FacebookProvider implements ISocialProvider {
14-
/** @var IClient */
15-
private $httpClient;
14+
private IClient $httpClient;
1615

1716
/** @var string */
1817
public $name = 'facebook';

lib/Service/Social/InstagramProvider.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
use Psr\Log\LoggerInterface;
1414

1515
class InstagramProvider implements ISocialProvider {
16-
/** @var IClient */
17-
private $httpClient;
18-
19-
/** @var LoggerInterface */
20-
private $logger;
16+
private IClient $httpClient;
2117

2218
/** @var string */
2319
public $name = 'instagram';
2420

25-
public function __construct(IClientService $httpClient,
26-
LoggerInterface $logger) {
21+
public function __construct(
22+
IClientService $httpClient,
23+
private LoggerInterface $logger,
24+
) {
2725
$this->httpClient = $httpClient->newClient();
28-
$this->logger = $logger;
2926
}
3027

3128
/**

lib/Service/Social/MastodonProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use OCP\Http\Client\IClientService;
1212

1313
class MastodonProvider implements ISocialProvider {
14-
/** @var IClient */
15-
private $httpClient;
14+
private IClient $httpClient;
1615

1716
/** @var string */
1817
public $name = 'mastodon';

lib/Service/Social/TelegramProvider.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
use Psr\Log\LoggerInterface;
1414

1515
class TelegramProvider implements ISocialProvider {
16-
/** @var IClient */
17-
private $httpClient;
18-
19-
/** @var LoggerInterface */
20-
private $logger;
16+
private IClient $httpClient;
2117

2218
/** @var string */
2319
public $name = 'telegram';
2420

25-
public function __construct(IClientService $httpClient,
26-
LoggerInterface $logger) {
21+
public function __construct(
22+
IClientService $httpClient,
23+
private LoggerInterface $logger,
24+
) {
2725
$this->httpClient = $httpClient->newClient();
28-
$this->logger = $logger;
2926
}
3027

3128
/**

lib/Service/Social/XingProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use OCP\Http\Client\IClientService;
1212

1313
class XingProvider implements ISocialProvider {
14-
/** @var IClient */
15-
private $httpClient;
14+
private IClient $httpClient;
1615

1716
/** @var string */
1817
public $name = 'xing';

lib/Service/SocialApiService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SocialApiService {
3232
'image/jpeg',
3333
'image/gif'
3434
];
35-
private $appName;
35+
private string $appName;
3636

3737
public function __construct(
3838
private CompositeSocialProvider $socialProvider,

0 commit comments

Comments
 (0)