| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | * @since 2.0.0 |
| 30 | 30 | */ |
| 31 | 31 | public function __construct() { |
| 32 | 32 | // Load PHPSpreadsheet via its autoloading mechanism. |
| 33 | - TablePress::load_file( 'autoload.php', 'libraries/vendor' ); | |
| 33 | + TablePress::load_file( 'autoload.php', 'libraries' ); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Imports a table from a file. |
| @@ -208,9 +208,9 @@ | ||
| 208 | 208 | $detected_format = strtolower( array_pop( $class_type ) ); |
| 209 | 209 | |
| 210 | 210 | if ( 'csv' === $detected_format ) { |
| 211 | 211 | $reader->setInputEncoding( \TablePress\PhpOffice\PhpSpreadsheet\Reader\Csv::GUESS_ENCODING ); // @phpstan-ignore method.notFound |
| 212 | - // @phpstan-ignore method.notFound, smaller.alwaysFalse (PHPStan thinks that the Composer minimum version will always be fulfilled.) | |
| 212 | + // @phpstan-ignore method.notFound | |
| 213 | 213 | $reader->setEscapeCharacter( ( PHP_VERSION_ID < 70400 ) ? "\x0" : '' ); // Disable the proprietary escape mechanism of PHP's fgetcsv() in PHP >= 7.4. |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $reader->setIncludeCharts( false ); |
| @@ -240,12 +240,12 @@ | ||
| 240 | 240 | $max_col = $worksheet->getHighestColumn(); |
| 241 | 241 | $max_row = $worksheet->getHighestRow(); |
| 242 | 242 | |
| 243 | 243 | // Adapted from \TablePress\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::rangeToArray(). |
| 244 | - \TablePress\PhpOffice\PhpSpreadsheet\Shared\StringHelper::stringIncrement( $max_col ); // Due to for-loop with characters for columns. | |
| 244 | + ++$max_col; // Due to for-loop with characters for columns. | |
| 245 | 245 | for ( $row = $min_row; $row <= $max_row; $row++ ) { |
| 246 | 246 | $row_data = array(); |
| 247 | - for ( $col = $min_col; $col !== $max_col; \TablePress\PhpOffice\PhpSpreadsheet\Shared\StringHelper::stringIncrement( $col ) ) { | |
| 247 | + for ( $col = $min_col; $col !== $max_col; $col++ ) { | |
| 248 | 248 | $cell_reference = $col . $row; |
| 249 | 249 | if ( ! $cell_collection->has( $cell_reference ) ) { |
| 250 | 250 | $row_data[] = ''; |
| 251 | 251 | continue; |