PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | libraries/vendor/PhpSpreadsheet/IOFactory.php +4 -3 3.3.1 → 3.4 View file →
@@ -2,9 +2,9 @@
2 2
3 3 namespace TablePress\PhpOffice\PhpSpreadsheet;
4 4
5 5 use TablePress\PhpOffice\PhpSpreadsheet\Reader\CsvNoEscape;
6 -use TablePress\PhpOffice\PhpSpreadsheet\Reader\IReader;
6 +use TablePress\PhpOffice\PhpSpreadsheet\Reader\IReader2 as IReader;
7 7 use TablePress\PhpOffice\PhpSpreadsheet\Shared\File;
8 8
9 9 /**
10 10 * Factory to create readers easily.
@@ -111,8 +111,10 @@
111 111 * Values in this list can be any of the constant values defined in the set
112 112 * IOFactory::READER_*.
113 113 * @param array<string, class-string<IReader>> $mergeArray supplied readers will be merged with
114 114 * default readers, allowing specification of a partial list.
115 + *
116 + * @throws Reader\Exception
115 117 */
116 118 public static function createReaderForFile(string $filename, ?array $readers = null, array $mergeArray = []): IReader
117 119 {
118 120 File::assertFile($filename);
@@ -197,10 +199,9 @@
197 199 * @param class-string<IReader> $readerClass
198 200 */
199 201 public static function registerReader(string $readerType, string $readerClass): void
200 202 {
201 - // We want phpstan to validate caller, but still need this test
202 - if (!is_a($readerClass, IReader::class, true)) { //* @phpstan-ignore-line
203 + if (!is_a($readerClass, IReader::class, true)) {
203 204 throw new Reader\Exception('Registered readers must implement ' . IReader::class);
204 205 }
205 206
206 207 self::$readers[$readerType] = $readerClass;