From ecda8302c9ae024bbf9011b5fd6bd0b48844f666 Mon Sep 17 00:00:00 2001 From: Cristian Balan Date: Sat, 2 Dec 2023 01:45:11 +0000 Subject: [PATCH] Fix Deprecated Functionality: explode(): Passing null to parameter #2 ($string) of type string is deprecated --- Console/Command/CategoriesCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Console/Command/CategoriesCommand.php b/Console/Command/CategoriesCommand.php index 567dfd2..c757cff 100644 --- a/Console/Command/CategoriesCommand.php +++ b/Console/Command/CategoriesCommand.php @@ -141,7 +141,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (!$path) { throw new LocalizedException(__('Please specify path to file! (eg. "var/import/categories.csv")')); } - $additionalHeadersDefinedByUser = explode(',', $input->getOption('additional')); + $additionalHeadersDefinedByUser = $input->getOption('additional') ? explode(',', $input->getOption('additional')) : []; $this->additionalHeaders = array_merge($this->additionalHeaders, $additionalHeadersDefinedByUser); $file = $this->directoryList->getRoot() . '/' . $path;