Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced Box/Spout by OpenSpout (fix #206). #207

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"box/spout": "^3.1"
"openspout/openspout": "^3.7"
}
}
52 changes: 36 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Source/AbstractSpreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Nevertheless, the library is quick and efficient and the module uses it only
* as recommended (as stream ahead).
*/
use Box\Spout\Common\Type;
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
use Box\Spout\Reader\ReaderInterface;
use Omeka\Stdlib\Message;
use OpenSpout\Common\Type;
use OpenSpout\Reader\Common\Creator\ReaderEntityFactory;
use OpenSpout\Reader\ReaderInterface;

abstract class AbstractSpreadsheet extends AbstractSource
{
Expand Down Expand Up @@ -50,7 +50,7 @@ protected function checkNumberOfColumnsByRow()
$result = true;
$headers = $this->getHeaders();
$number = count($headers);
/** @var \Box\Spout\Common\Entity\Row $row */
/** @var \OpenSpout\Common\Entity\Row $row */
foreach ($iterator as $row) {
if ($row && $row->getNumCells() !== $number) {
$result = false;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function getRows($offset = 0, $limit = -1)
$rowOffset = $offset;
$hasRows = false;
while ($iterator->valid()) {
/** @var \Box\Spout\Common\Entity\Row $row */
/** @var \OpenSpout\Common\Entity\Row $row */
$row = $iterator->current();
if (is_null($row)) {
$iterator->next();
Expand Down Expand Up @@ -154,7 +154,7 @@ protected function prepareIterator()
}
try {
$this->reader->open($this->source);
} catch (\Box\Spout\Common\Exception\IOException $e) {
} catch (\OpenSpout\Common\Exception\IOException $e) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Source/OpenDocumentSpreadsheet.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace CSVImport\Source;

use Box\Spout\Common\Type;
use OpenSpout\Common\Type;

class OpenDocumentSpreadsheet extends AbstractSpreadsheet
{
Expand All @@ -19,7 +19,7 @@ protected function checkNumberOfColumnsByRow()
$result = true;
$headers = $this->getHeaders();
$number = count($headers);
/** @var \Box\Spout\Common\Entity\Row $row */
/** @var \OpenSpout\Common\Entity\Row $row */
foreach ($iterator as $row) {
if ($row && $row->getNumCells() !== $number) {
// When old columns are removed on the right, the flag may not
Expand Down