Skip to content

Commit ed165f3

Browse files
Merge pull request #61251 from nextcloud/backport/61017/stable33
[stable33] fix: use card interface instead of object
2 parents c893d32 + 14c741d commit ed165f3

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/dav/lib/CardDAV/HasPhotoPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
namespace OCA\DAV\CardDAV;
1010

11-
use Sabre\CardDAV\Card;
11+
use Sabre\CardDAV\ICard;
1212
use Sabre\DAV\INode;
1313
use Sabre\DAV\PropFind;
1414
use Sabre\DAV\Server;
@@ -41,7 +41,7 @@ public function initialize(Server $server) {
4141
public function propFind(PropFind $propFind, INode $node) {
4242
$ns = '{http://nextcloud.com/ns}';
4343

44-
if ($node instanceof Card) {
44+
if ($node instanceof ICard) {
4545
$propFind->handle($ns . 'has-photo', function () use ($node) {
4646
$vcard = Reader::read($node->get());
4747
return $vcard instanceof VCard

apps/dav/lib/CardDAV/ImageExportPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use OCP\AppFramework\Http;
1111
use OCP\Files\NotFoundException;
12-
use Sabre\CardDAV\Card;
12+
use Sabre\CardDAV\ICard;
1313
use Sabre\DAV\Server;
1414
use Sabre\DAV\ServerPlugin;
1515
use Sabre\HTTP\RequestInterface;
@@ -61,7 +61,7 @@ public function httpGet(RequestInterface $request, ResponseInterface $response)
6161
$path = $request->getPath();
6262
$node = $this->server->tree->getNodeForPath($path);
6363

64-
if (!$node instanceof Card) {
64+
if (!$node instanceof ICard) {
6565
return true;
6666
}
6767

apps/dav/lib/CardDAV/PhotoCache.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use OCP\Files\SimpleFS\ISimpleFolder;
1616
use OCP\Image;
1717
use Psr\Log\LoggerInterface;
18-
use Sabre\CardDAV\Card;
18+
use Sabre\CardDAV\ICard;
1919
use Sabre\VObject\Document;
2020
use Sabre\VObject\Parameter;
2121
use Sabre\VObject\Property\Binary;
@@ -43,7 +43,7 @@ public function __construct(
4343
/**
4444
* @throws NotFoundException
4545
*/
46-
public function get(int $addressBookId, string $cardUri, int $size, Card $card): ISimpleFile {
46+
public function get(int $addressBookId, string $cardUri, int $size, ICard $card): ISimpleFile {
4747
$folder = $this->getFolder($addressBookId, $cardUri);
4848

4949
if ($this->isEmpty($folder)) {
@@ -68,7 +68,7 @@ private function isEmpty(ISimpleFolder $folder): bool {
6868
/**
6969
* @throws NotPermittedException
7070
*/
71-
private function init(ISimpleFolder $folder, Card $card): void {
71+
private function init(ISimpleFolder $folder, ICard $card): void {
7272
$data = $this->getPhoto($card);
7373

7474
if ($data === false || !isset($data['Content-Type'])) {
@@ -168,10 +168,10 @@ private function getExtension(ISimpleFolder $folder): string {
168168
}
169169

170170
/**
171-
* @param Card $node
171+
* @param ICard $node
172172
* @return false|array{body: string, Content-Type: string}
173173
*/
174-
private function getPhoto(Card $node) {
174+
private function getPhoto(ICard $node) {
175175
try {
176176
$vObject = $this->readCard($node->get());
177177
return $this->getPhotoFromVObject($vObject);

0 commit comments

Comments
 (0)