Skip to content

Commit

Permalink
resolve dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AnourValar committed Jul 13, 2024
1 parent 24fc3ba commit f7a8bb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ composer require anourvalar/office
### Phpspreadsheet is required to work with Excel (xlsx).

```bash
composer require phpoffice/phpspreadsheet "^1.28"
composer require phpoffice/phpspreadsheet "^1.29"
```

### Zipstream-php is required to work with Word (docx).

```bash
composer require maennchen/zipstream-php "^2.4"
composer require maennchen/zipstream-php "^3.1"
```

### Mpdf is required to work with PDF.
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ parameters:
- '#Binary operation \"\-\" between string and string results in an error#'
- '#Instantiated class PhpOffice#'
- '#expects string, int given#'
- '#expects int, string given#'
- '#has invalid type PhpOffice#'
- '#Match expression does not handle remaining value: mixed#'
- '#Access to an undefined property AnourValar\\Office\\Drivers\\MixInterface\:\:\$spreadsheet#'
Expand Down
6 changes: 5 additions & 1 deletion src/Drivers/ZipDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ public function save(string $file, \AnourValar\Office\Format $format): void
throw new \LogicException('Driver only supports saving in the same format.');
}

$zipStream = new \ZipStream\ZipStream();
if (class_exists(\ZipStream\Option\Archive::class)) {
$zipStream = new \ZipStream\ZipStream(); // 2.x
} else {
$zipStream = new \ZipStream\ZipStream(sendHttpHeaders: false, defaultEnableZeroHeader: false); // 3.x
}
ob_start();

try {
Expand Down

0 comments on commit f7a8bb7

Please sign in to comment.