Skip to content

Commit

Permalink
Move dracoblue/naith as dev; Switch to phpoffice/phpspreadsheet (#40)…
Browse files Browse the repository at this point in the history
…, update php req

* Move dracoblue/naith as dev
* Switch to phpoffice/phpspreadsheet;
* Update PHP req
  • Loading branch information
llupa authored Oct 30, 2020
1 parent 7945483 commit f414124
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
language: php
matrix:
include:
- php: 5.3
dist: precise
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4

before_script: "make install-dependencies"
script: "make test && cat junit.xml"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ element, you can do this:

## Changelog

- 3.0.0 (2020/10/22)
- moved `dracoblue/naith` as a dev dependency
- dropped `phpoffice/phpexcel` for `phpoffice/phpspreadsheet` instead
- dropped support for `PHP 5`, `PHP 7.0` and `PHP 7.1`
- 2.1.1 (2017/12/12)
- added compatibility to symfony/yaml 4.x
- 2.1.0 (2017/03/13)
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
}
],
"require": {
"php": ">=5.3.0",
"dracoblue/naith": "^1.1",
"phpoffice/phpexcel": "^1.7",
"php": "^7.2",
"phpoffice/phpspreadsheet": "^1.12",
"symfony/yaml": "^2.0 || ^3.0 || ^4.0"
},
"require-dev": {
"dracoblue/naith": "^1.1"
},
"autoload": {
"classmap": [ "src/" ]
},
Expand Down
7 changes: 5 additions & 2 deletions src/Craur.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ static function createFromCsvFile($file_path, array $field_mappings)
* assert(in_array($author->get('name'), array('Hans', 'Paul', 'Erwin')));
* }
* }
*
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*
* @return Craur
*/
static function createFromExcelFile($file_path, array $field_mappings)
Expand All @@ -310,7 +312,8 @@ static function createFromExcelFile($file_path, array $field_mappings)

$entries = array();

$excel_object = PHPExcel_IOFactory::load($file_path);
$excel_type = \PhpOffice\PhpSpreadsheet\IOFactory::identify($file_path);
$excel_object = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($excel_type)->load($file_path);

$rows = $excel_object->getActiveSheet()->toArray(null,true,true,true);

Expand Down

0 comments on commit f414124

Please sign in to comment.