diff --git a/README.md b/README.md index 1c54519..31c3262 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Some metadata can be stored into `extras()` method, without typing, directly fro ```php $ebook->extras(); // array => additional data for book -$ebook->extrasExtract(string $key); // mixed => safely extract data from `extras` array +$ebook->extra(string $key); // mixed => safely extract data from `extras` array ``` To get additional data, you can use these methods: diff --git a/composer.json b/composer.json index 768f8e4..5b78866 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "kiwilan/php-ebook", "description": "PHP package to read metadata and extract covers from eBooks (.epub, .cbz, .cbr, .cb7, .cbt, .pdf) and audiobooks (.mp3, .m4a, .m4b, .flac, .ogg).", - "version": "1.3.36", + "version": "1.3.4", "keywords": [ "php", "ebook", diff --git a/src/Ebook.php b/src/Ebook.php index 85acc89..f178eca 100755 --- a/src/Ebook.php +++ b/src/Ebook.php @@ -509,7 +509,7 @@ public function extras(): array /** * Get key from `extras` safely. */ - public function extrasExtract(string $key): mixed + public function extra(string $key): mixed { if (! array_key_exists($key, $this->extras)) { return null; diff --git a/tests/EpubTest.php b/tests/EpubTest.php index f3d9726..262c798 100644 --- a/tests/EpubTest.php +++ b/tests/EpubTest.php @@ -41,8 +41,8 @@ expect($ebook->extras()['contributor'])->toBeString(); expect($ebook->extras()['rating'])->toBeFloat(); expect($ebook->extras()['rating'])->toBe(10.0); - expect($ebook->extrasExtract('contributor'))->toBeString(); - expect($ebook->extrasExtract('contributora'))->toBeNull(); + expect($ebook->extra('contributor'))->toBeString(); + expect($ebook->extra('contributora'))->toBeNull(); $metadata = $ebook->metadata(); expect($metadata->toArray())->toBeArray();