Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jszobody committed Jul 5, 2024
1 parent 4927735 commit 99b7e58
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions src/ZipStreamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,8 @@ public function configurePackage(Package $package): void
});
}

/**
* @return array
*/
public function provides()
public function provides(): array
{
return [FileOptions::class, ArchiveOptions::class, 'zipstream', 'zipstream.s3client'];
}

/**
* @return ArchiveOptions
*/
protected function buildArchiveOptions(array $config)
{
return tap(new ArchiveOptions(), function(ArchiveOptions $options) use($config) {
$options->setZeroHeader(true);
});
}

/**
* @return FileOptions
*/
protected function buildFileOptions(array $config)
{
return tap(new FileOptions(), function(FileOptions $options) use($config) {
$options->setMethod(Method::{strtoupper($config['method'])}());

if($config['deflate']) {
$options->setDeflateLevel($config['deflate']);
}
});
return ['zipstream.builder', 'zipstream.s3client'];
}
}

0 comments on commit 99b7e58

Please sign in to comment.