mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-08 21:28:23 +00:00
Fix deprecation notice League/csv for createFromStream and createFromPath replaced by new from() method
This commit is contained in:
@@ -49,7 +49,7 @@ final class ImportSocialWorkMetadata extends Command
|
||||
$filepath = $input->getOption('filepath');
|
||||
|
||||
try {
|
||||
$csv = Reader::createFromPath($filepath);
|
||||
$csv = Reader::from($filepath);
|
||||
} catch (\Throwable $e) {
|
||||
throw new \Exception('Error while loading CSV.', 0, $e);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
try {
|
||||
$csv = Reader::createFromPath(__DIR__.'/data/social_work_metadata.csv');
|
||||
$csv = Reader::from(__DIR__.'/data/social_work_metadata.csv');
|
||||
} catch (\Throwable $e) {
|
||||
throw new \Exception('Error while loading CSV.', 0, $e);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ final readonly class SocialActionCSVExportService
|
||||
array_keys($this->formatRow(new SocialAction()))
|
||||
);
|
||||
|
||||
$csv = Writer::createFromPath('php://temp', 'w+');
|
||||
$csv = Writer::from('php://temp', 'w+');
|
||||
$csv->insertOne($headers);
|
||||
|
||||
foreach ($actions as $action) {
|
||||
|
||||
@@ -36,7 +36,7 @@ readonly class SocialIssueCSVExportService
|
||||
public function generateCsv(array $issues): Writer
|
||||
{
|
||||
// CSV headers
|
||||
$csv = Writer::createFromPath('php://temp', 'r+');
|
||||
$csv = Writer::from('php://temp', 'r+');
|
||||
$csv->insertOne(
|
||||
array_map(
|
||||
fn (string $e) => $this->translator->trans($e),
|
||||
|
||||
Reference in New Issue
Block a user