From dce6762e2d1c9dced12d8b140f940aa3e7e6dc8a Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Fri, 3 Jan 2025 01:02:41 +0800 Subject: [PATCH] fix deprecate notice --- composer.json | 2 +- packages/actions/composer.json | 2 +- packages/actions/src/Concerns/CanImportRecords.php | 4 ++-- packages/actions/src/Exports/Jobs/PrepareCsvExport.php | 4 ++-- .../src/Imports/Http/Controllers/DownloadImportFailureCsv.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a2626203d1..33ee5805c9 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "filament/support": "*", "larastan/larastan": "^2.2", "laravel/pint": "^1.0", - "league/csv": "^9.14", + "league/csv": "^9.16", "league/flysystem-aws-s3-v3": "^3.0", "nunomaduro/termwind": "^1.0|^2.0", "openspout/openspout": "^4.23", diff --git a/packages/actions/composer.json b/packages/actions/composer.json index fc480843bb..ccfcb4584a 100644 --- a/packages/actions/composer.json +++ b/packages/actions/composer.json @@ -17,7 +17,7 @@ "illuminate/contracts": "^10.45|^11.0", "illuminate/database": "^10.45|^11.0", "illuminate/support": "^10.45|^11.0", - "league/csv": "^9.14", + "league/csv": "^9.16", "openspout/openspout": "^4.23", "spatie/laravel-package-tools": "^1.9" }, diff --git a/packages/actions/src/Concerns/CanImportRecords.php b/packages/actions/src/Concerns/CanImportRecords.php index 7e70050a75..7092360993 100644 --- a/packages/actions/src/Concerns/CanImportRecords.php +++ b/packages/actions/src/Concerns/CanImportRecords.php @@ -32,7 +32,7 @@ use Illuminate\Support\Str; use Illuminate\Validation\Rules\File; use Illuminate\Validation\ValidationException; -use League\Csv\ByteSequence; +use League\Csv\Bom; use League\Csv\CharsetConverter; use League\Csv\Info; use League\Csv\Reader as CsvReader; @@ -343,7 +343,7 @@ protected function setUp(): void $columns = $this->getImporter()::getColumns(); $csv = Writer::createFromFileObject(new SplTempFileObject); - $csv->setOutputBOM(ByteSequence::BOM_UTF8); + $csv->setOutputBOM(Bom::Utf8); if (filled($csvDelimiter = $this->getCsvDelimiter())) { $csv->setDelimiter($csvDelimiter); diff --git a/packages/actions/src/Exports/Jobs/PrepareCsvExport.php b/packages/actions/src/Exports/Jobs/PrepareCsvExport.php index f0bddf3f83..00702cba06 100644 --- a/packages/actions/src/Exports/Jobs/PrepareCsvExport.php +++ b/packages/actions/src/Exports/Jobs/PrepareCsvExport.php @@ -15,7 +15,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Arr; use Illuminate\Support\Collection; -use League\Csv\ByteSequence; +use League\Csv\Bom; use League\Csv\Writer; use SplTempFileObject; @@ -53,7 +53,7 @@ public function __construct( public function handle(): void { $csv = Writer::createFromFileObject(new SplTempFileObject); - $csv->setOutputBOM(ByteSequence::BOM_UTF8); + $csv->setOutputBOM(Bom::Utf8); $csv->setDelimiter($this->exporter::getCsvDelimiter()); $csv->insertOne(array_values($this->columnMap)); diff --git a/packages/actions/src/Imports/Http/Controllers/DownloadImportFailureCsv.php b/packages/actions/src/Imports/Http/Controllers/DownloadImportFailureCsv.php index 6eec8cc159..7a39bf5413 100644 --- a/packages/actions/src/Imports/Http/Controllers/DownloadImportFailureCsv.php +++ b/packages/actions/src/Imports/Http/Controllers/DownloadImportFailureCsv.php @@ -5,7 +5,7 @@ use Filament\Actions\Imports\Models\FailedImportRow; use Filament\Actions\Imports\Models\Import; use Illuminate\Support\Facades\Gate; -use League\Csv\ByteSequence; +use League\Csv\Bom; use League\Csv\Writer; use SplTempFileObject; use Symfony\Component\HttpFoundation\StreamedResponse; @@ -23,7 +23,7 @@ public function __invoke(Import $import): StreamedResponse } $csv = Writer::createFromFileObject(new SplTempFileObject); - $csv->setOutputBOM(ByteSequence::BOM_UTF8); + $csv->setOutputBOM(Bom::Utf8); $firstFailedRow = $import->failedRows()->first();