Skip to content

Commit

Permalink
Merge pull request #24 from kiwilan/develop
Browse files Browse the repository at this point in the history
1.3.4
  • Loading branch information
ewilan-riviere committed Jun 28, 2023
2 parents b49db3f + e5217be commit 4ee34d7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Some metadata can be stored into `extras()` method, without typing, directly fro

```php
$ebook->extras(); // array<string, mixed> => 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:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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.35",
"version": "1.3.4",
"keywords": [
"php",
"ebook",
Expand Down Expand Up @@ -36,7 +36,7 @@
"php": "^8.1",
"kiwilan/php-archive": "^1.4.02",
"kiwilan/php-audio": "^2.0.0",
"kiwilan/php-xml-reader": "^0.2.22"
"kiwilan/php-xml-reader": "^0.2.30"
},
"require-dev": {
"laravel/pint": "^1.7",
Expand Down
2 changes: 1 addition & 1 deletion src/Ebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/Formats/Epub/EpubContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ private function parseOpfPath(): ?string
return null;
}

$rootfile = reset($rootfile);
$rootAttr = XmlReader::getAttributes($rootfile);

if (! $rootAttr) {
Expand Down
4 changes: 2 additions & 2 deletions tests/CbaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
expect($comicMeta->alternateCount())->toBeNull();
expect($comicMeta->alternateNumber())->toBeNull();
expect($comicMeta->seriesGroup())->toBe('Fantastic Four');
expect($comicMeta->count())->toBe(24);
expect($comicMeta->count())->toBeNull();
expect($comicMeta->volume())->toBeNull();
expect($comicMeta->storyArc())->toBeNull();
expect($comicMeta->storyArcNumber())->toBeNull();
Expand Down Expand Up @@ -165,7 +165,7 @@
expect($cbam->alternateSeries())->toBeString();
expect($cbam->alternateNumber())->toBeNull();
expect($cbam->alternateCount())->toBeNull();
expect($cbam->count())->toBe(24);
expect($cbam->count())->toBeNull();
expect($cbam->volume())->toBeNull();
expect($cbam->storyArc())->toBeNull();
expect($cbam->storyArcNumber())->toBeNull();
Expand Down
4 changes: 2 additions & 2 deletions tests/EpubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4ee34d7

Please sign in to comment.