@@ -425,11 +425,9 @@ public function withMetadata(array $metadata, bool $overwrite = false): FileInte
425
425
}
426
426
427
427
/**
428
- * @param string $name Name
429
- * @param mixed $data Data
430
- * @return \Phauthentic\Infrastructure\Storage\FileInterface
428
+ * @inheritDoc
431
429
*/
432
- public function withMetadataKey (string $ name , $ data ): FileInterface
430
+ public function withMetadataByKey (string $ name , $ data ): FileInterface
433
431
{
434
432
$ that = clone $ this ;
435
433
$ that ->metadata [$ name ] = $ data ;
@@ -438,10 +436,9 @@ public function withMetadataKey(string $name, $data): FileInterface
438
436
}
439
437
440
438
/**
441
- * @param string $name Name
442
- * @return \Phauthentic\Infrastructure\Storage\FileInterface
439
+ * @inheritDoc
443
440
*/
444
- public function withoutMetadataKey (string $ name ): FileInterface
441
+ public function withoutMetadataByKey (string $ name ): FileInterface
445
442
{
446
443
$ that = clone $ this ;
447
444
unset($ that ->metadata [$ name ]);
@@ -450,7 +447,7 @@ public function withoutMetadataKey(string $name): FileInterface
450
447
}
451
448
452
449
/**
453
- * @return $this
450
+ * @inheritDoc
454
451
*/
455
452
public function withoutMetadata (): self
456
453
{
@@ -461,7 +458,7 @@ public function withoutMetadata(): self
461
458
}
462
459
463
460
/**
464
- * @return array
461
+ * @inheritDoc
465
462
*/
466
463
public function metadata (): array
467
464
{
@@ -540,6 +537,29 @@ public function variantPaths(): array
540
537
return $ paths ;
541
538
}
542
539
540
+ /**
541
+ * @param string $key
542
+ * @param mixed $data;
543
+ */
544
+ public function withMetadataKey (string $ key , $ data ): FileInterface
545
+ {
546
+ $ that = clone $ this ;
547
+ $ that ->metadata [$ key ] = $ data ;
548
+
549
+ return $ that ;
550
+ }
551
+
552
+ /**
553
+ * @inheritDoc
554
+ */
555
+ public function withoutMetadataKey (string $ key ): FileInterface
556
+ {
557
+ $ that = clone $ this ;
558
+ unset($ that ->metadata [$ key ]);
559
+
560
+ return $ that ;
561
+ }
562
+
543
563
/**
544
564
* Sets many variants at once
545
565
*
@@ -612,7 +632,7 @@ public function toArray(): array
612
632
/**
613
633
* @inheritDoc
614
634
*/
615
- public function jsonSerialize ()
635
+ public function jsonSerialize (): array
616
636
{
617
637
return $ this ->toArray ();
618
638
}
0 commit comments