Skip to content

Commit

Permalink
Improve stream filter removal
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Dec 18, 2024
1 parent c41bed7 commit a035f41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ All Notable changes to `Csv` will be documented in this file

### Fixed

- None
- [#554](https://github.com/thephpleague/csv/pull/544) Fix stream filte removal
- Fix Statement callaback signature

### Removed

Expand Down
4 changes: 3 additions & 1 deletion src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function __destruct()
{
array_walk_recursive($this->filters, static function ($filter): void {
if (is_resource($filter)) {
@stream_filter_remove($filter);
set_error_handler(fn (int $errno, string $errstr, string $errfile, int $errline) => true);
stream_filter_remove($filter);
restore_error_handler();
}
});

Expand Down

0 comments on commit a035f41

Please sign in to comment.