Skip to content

Commit 0ef2f40

Browse files
Merge pull request #61017 from nextcloud/fix/use-card-interface
fix: use card interface instead of object
2 parents e1eea9b + 507e620 commit 0ef2f40

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
@@ -9,7 +9,7 @@
99

1010
namespace OCA\DAV\CardDAV;
1111

12-
use Sabre\CardDAV\Card;
12+
use Sabre\CardDAV\ICard;
1313
use Sabre\DAV\INode;
1414
use Sabre\DAV\PropFind;
1515
use Sabre\DAV\Server;
@@ -43,7 +43,7 @@ public function initialize(Server $server) {
4343
public function propFind(PropFind $propFind, INode $node) {
4444
$ns = '{http://nextcloud.com/ns}';
4545

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

apps/dav/lib/CardDAV/ImageExportPlugin.php

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

1111
use OCP\AppFramework\Http;
1212
use OCP\Files\NotFoundException;
13-
use Sabre\CardDAV\Card;
13+
use Sabre\CardDAV\ICard;
1414
use Sabre\DAV\Server;
1515
use Sabre\DAV\ServerPlugin;
1616
use Sabre\HTTP\RequestInterface;
@@ -64,7 +64,7 @@ public function httpGet(RequestInterface $request, ResponseInterface $response)
6464
$path = $request->getPath();
6565
$node = $this->server->tree->getNodeForPath($path);
6666

67-
if (!$node instanceof Card) {
67+
if (!$node instanceof ICard) {
6868
return true;
6969
}
7070

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)