From 968f9e498ea17e71bcc0bbfdc7645aad3cbc7342 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 13 Apr 2024 18:56:42 +0200 Subject: [PATCH] Remove redundant code & double doc blocks --- src/EncodedImage.php | 12 ++++---- src/File.php | 22 +++++++------- src/Interfaces/EncodedImageInterface.php | 38 +----------------------- 3 files changed, 17 insertions(+), 55 deletions(-) diff --git a/src/EncodedImage.php b/src/EncodedImage.php index 3ee15b59..2caadcc9 100644 --- a/src/EncodedImage.php +++ b/src/EncodedImage.php @@ -21,9 +21,9 @@ public function __construct( } /** - * Return media (mime) type of encoed image data + * {@inheritdoc} * - * @return string + * @see EncodedImageInterface::mediaType() */ public function mediaType(): string { @@ -31,9 +31,9 @@ public function mediaType(): string } /** - * Alias of self::mediaType() + * {@inheritdoc} * - * @return string + * @see EncodedImageInterface::mimetype() */ public function mimetype(): string { @@ -41,9 +41,9 @@ public function mimetype(): string } /** - * Transform encoded image data into an data uri string + * {@inheritdoc} * - * @return string + * @see EncodedImageInterface::toDataUri() */ public function toDataUri(): string { diff --git a/src/File.php b/src/File.php index e0f8aa73..fe5eda8c 100644 --- a/src/File.php +++ b/src/File.php @@ -22,11 +22,9 @@ public function __construct(protected string $data) } /** - * Save encoded image data in file system + * {@inheritdoc} * - * @codeCoverageIgnore - * @param string $filepath - * @return void + * @see FileInterface::save() */ public function save(string $filepath): void { @@ -54,9 +52,9 @@ public function save(string $filepath): void } /** - * Cast encoded image object to string + * {@inheritdoc} * - * @return string + * @see FilterInterface::toString() */ public function toString(): string { @@ -64,9 +62,9 @@ public function toString(): string } /** - * Create file pointer from encoded image + * {@inheritdoc} * - * @return resource + * @see FilterInterface::toFilePointer() */ public function toFilePointer() { @@ -74,9 +72,9 @@ public function toFilePointer() } /** - * Return byte size of encoded image + * {@inheritdoc} * - * @return int + * @see FileInterface::size() */ public function size(): int { @@ -84,9 +82,9 @@ public function size(): int } /** - * Cast encoded image object to string + * {@inheritdoc} * - * @return string + * @see FileInterface::__toString() */ public function __toString(): string { diff --git a/src/Interfaces/EncodedImageInterface.php b/src/Interfaces/EncodedImageInterface.php index b50f8232..46c1dc04 100644 --- a/src/Interfaces/EncodedImageInterface.php +++ b/src/Interfaces/EncodedImageInterface.php @@ -21,45 +21,9 @@ public function mediaType(): string; public function mimetype(): string; /** - * Turn encoded image into DataUri format + * Transform encoded image data into an data uri string * * @return string */ public function toDataUri(): string; - - /** - * Save encoded image in filesystem - * - * @param string $filepath - * @return void - */ - public function save(string $filepath): void; - - /** - * Cast encoded image to string - * - * @return string - */ - public function toString(): string; - - /** - * Return file pointer of encoded image data - * - * @return resource - */ - public function toFilePointer(); - - /** - * Return size in bytes of encoded image - * - * @return int - */ - public function size(): int; - - /** - * Cast encoded image data to string - * - * @return string - */ - public function __toString(): string; }