Skip to content

Commit 9be4fad

Browse files
committed
fix: fix zip archive not initialized
1 parent a4ac96c commit 9be4fad

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "espresso-tutorials/php-epub",
33
"type": "library",
44
"license": "ISC",
5-
"version": "0.2.0",
5+
"version": "0.3.0",
66
"autoload": {
77
"psr-4": {
88
"EspressoTutorials\\Epub\\": "src/"

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Epub.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
class Epub
66
{
7-
protected \ZipArchive $archive;
8-
97
protected ?Container $container = null;
108

119
protected ?Content $content = null;
@@ -41,13 +39,13 @@ public function content(): Content
4139

4240
public function extractTo(string $path): bool
4341
{
44-
$this->archive = new \ZipArchive();
42+
$archive = new \ZipArchive();
4543

46-
if (!$this->archive->open($this->path)) {
44+
if (!$archive->open($this->path)) {
4745
return false;
4846
}
4947

50-
if (!$this->archive->extractTo($path)) {
48+
if (!$archive->extractTo($path)) {
5149
return false;
5250
}
5351

0 commit comments

Comments
 (0)