Skip to content

Commit 0dd95b1

Browse files
authored
Merge pull request #71 from utopia-php/fix-warnings
Fix warnings
2 parents 845fd04 + c74d830 commit 0dd95b1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Migration/Sources/Appwrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ private function exportAttributes(int $batchSize): void
743743

744744
switch ($attribute['type']) {
745745
case Attribute::TYPE_STRING:
746-
$attr = match ($attribute['format']) {
746+
$attr = match ($attribute['format'] ?? '') {
747747
Attribute::TYPE_EMAIL => new Email(
748748
$attribute['key'],
749749
$collection,

src/Migration/Sources/Appwrite/Reader/API.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ public function queryEqual(string $attribute, array $values): string
190190
*/
191191
public function queryCursorAfter(Resource|string $resource): string
192192
{
193-
if (!\is_string($resource)) {
194-
throw new \InvalidArgumentException('Querying with a cursor through the API requires a string resource ID');
193+
if ($resource instanceof Resource) {
194+
$resource = $resource->getId();
195195
}
196196

197197
return Query::cursorAfter($resource);

0 commit comments

Comments
 (0)