![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/syn.corals.io/vendor/box/spout/src/Spout/Reader/Common/Creator/ |
<?php namespace Box\Spout\Reader\Common\Creator; use Box\Spout\Common\Exception\UnsupportedTypeException; use Box\Spout\Common\Type; use Box\Spout\Reader\ReaderInterface; /** * Class ReaderEntityFactory * Factory to create external entities */ class ReaderEntityFactory { /** * Creates a reader by file extension * * @param string $path The path to the spreadsheet file. Supported extensions are .csv, .ods and .xlsx * @throws \Box\Spout\Common\Exception\UnsupportedTypeException * @return ReaderInterface */ public static function createReaderFromFile(string $path) { return ReaderFactory::createFromFile($path); } /** * This creates an instance of a CSV reader * * @return \Box\Spout\Reader\CSV\Reader */ public static function createCSVReader() { try { return ReaderFactory::createFromType(Type::CSV); } catch (UnsupportedTypeException $e) { // should never happen } } /** * This creates an instance of a XLSX reader * * @return \Box\Spout\Reader\XLSX\Reader */ public static function createXLSXReader() { try { return ReaderFactory::createFromType(Type::XLSX); } catch (UnsupportedTypeException $e) { // should never happen } } /** * This creates an instance of a ODS reader * * @return \Box\Spout\Reader\ODS\Reader */ public static function createODSReader() { try { return ReaderFactory::createFromType(Type::ODS); } catch (UnsupportedTypeException $e) { // should never happen } } }