From 961e6387c3ee2f08f439cca17d25a90156198c65 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 12 Jan 2021 18:45:23 +1300 Subject: [PATCH] Use php to require an array Removes is_array check in favour of php strict typing --- CRM/Activity/Import/Parser.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index 9de96fd44d6d..4db39c89fc2f 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -44,7 +44,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { protected $_haveColumnHeader; /** - * @param string $fileName + * @param array $fileName * @param string $separator * @param $mapper * @param bool $skipColumnHeader @@ -57,7 +57,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @throws Exception */ public function run( - $fileName, + array $fileName, $separator = ',', &$mapper, $skipColumnHeader = FALSE, @@ -66,9 +66,7 @@ public function run( $statusID = NULL, $totalRowCount = NULL ) { - if (!is_array($fileName)) { - throw new CRM_Core_Exception('Unable to determine import file'); - } + $fileName = $fileName['name']; $this->init();