/** * ExcelReader constructor. * @param Configuration $config */ public function __construct(Configuration $config) { $filename = $config->get(array('filename')); $header = $config->get(array('header'), false) ? 0 : null; $sheet = $config->get(array('sheet'), 0); parent::__construct(new \SplFileObject($filename), $header, $sheet); }
/** * * @param string $jotFormUrl * @param string|null $password * @throws UnableToRetrieveCsvFile */ public function __construct($jotFormUrl, $password = null) { // My Constructor $this->jotFormUrl = $jotFormUrl; $this->password = $password; $downloadHelper = new JotFormDownloadHelper(); // Download Excel-File from jotForm $filePath = $downloadHelper->downloadFromJotForm($jotFormUrl, $password); $splFile = new \SplFileObject($filePath); // Parent Construct parent::__construct($splFile, $rowNumber = 0); }