Skip to content
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
6 changes: 2 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
spec/ export-ignore
tests/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
phpspec.yml.dist export-ignore
phpunit.xml.dist export-ignore
.github/ export-ignore
UPGRADE-2.0.md export-ignore
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
- package-ecosystem: composer
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 5
versioning-strategy: widen
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer:v2
extensions: zip, gd, xml, mbstring

- name: Validate Composer metadata
run: |
if [ -f composer.lock ]; then
composer validate --strict --no-interaction
else
composer validate --strict --no-check-lock --no-interaction
fi

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer packages
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json', '**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-versions }}-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --prefer-dist --no-progress --no-interaction
else
composer update --prefer-dist --no-progress --no-interaction
fi

- name: Run test suite
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.phar
composer.lock
phpspec.yml
phpunit.xml
vendor/
7 changes: 0 additions & 7 deletions .scrutinizer.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@
# portphp/spreadsheet

[![Latest Version](https://img.shields.io/github/release/portphp/spreadsheet.svg?style=flat-square)](https://github.com/portphp/spreadsheet/releases)
[![Build Status](https://travis-ci.org/portphp/spreadsheet.svg)](https://travis-ci.org/portphp/spreadsheet)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/portphp/spreadsheet/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/portphp/spreadsheet/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/portphp/spreadsheet/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/portphp/spreadsheet/?branch=master)
[![CI](https://github.com/portphp/spreadsheet/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/portphp/spreadsheet/actions/workflows/test.yml)
[![PHP Version](https://img.shields.io/packagist/php-v/portphp/spreadsheet.svg?style=flat-square)](https://packagist.org/packages/portphp/spreadsheet)

[PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) reader and writer
for [Port](https://github.com/portphp).
**Requirements:** PHP ^8.2 (tested on 8.2–8.5). Requires `portphp/portphp` ^2.0 and PhpSpreadsheet ^1.29 || ^2–^5.

## Installation
[PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) reader and writer for [Port](https://github.com/portphp).

> Prefer this package over `portphp/excel` (PHPExcel, abandoned).

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this package:
## Installation

```bash
$ composer require portphp/spreadsheet
```

This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

## Documentation

Documentation is available at http://docs.portphp.org.
Documentation is available at https://portphp.readthedocs.io.

## Issues and feature requests

Please report issues and request features at https://github.com/portphp/portphp/issues.

## Contributing

Contributions are very welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for
details. Thanks to [everyone who has contributed](https://github.com/portphp/spreadsheet/graphs/contributors)
already.

## Security

If you discover any security-related issues, please contact us at
[security@portphp.org](mailto:security@portphp.org).

## License

This package is licensed under the [MIT license](LICENSE).
9 changes: 9 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Upgrade from 1.x to 2.0

- Minimum PHP is **8.2** (`^8.2`).
- Requires `portphp/portphp` **^2.0**.
- Writer methods use `: void` return types from the core interfaces.
- Iterator methods on `SpreadsheetReader` use PHP 8 return types (`mixed`, `void`, etc.).
- `phpoffice/phpspreadsheet` supports **^1.29 || ^2 || ^3 || ^4 || ^5** (uses coordinate API compatible with 2+).
- CI is GitHub Actions (Travis/Scrutinizer removed).
- PHPUnit 9 replaces the old PHPUnit 4 suite; phpspec is no longer a dependency.
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@
"support": {
"issues": "https://github.com/portphp/portphp/issues",
"source": "https://github.com/portphp/spreadsheet",
"docs": "http://docs.portphp.org"
"docs": "https://portphp.readthedocs.io"
},
"require": {
"php": ">=5.6.0",
"portphp/portphp": "^1.3",
"phpoffice/phpspreadsheet": "^1.3"
"php": "^8.2",
"portphp/portphp": "^2.0",
"phpoffice/phpspreadsheet": "^1.29 || ^2.0 || ^3.0 || ^4.0 || ^5.0"
},
"autoload": {
"psr-4": {
"Port\\Spreadsheet\\": "src/"
}
},
"require-dev": {
"phpunit/phpunit": "^4.0",
"phpspec/phpspec": "^2.1"
"phpunit/phpunit": "^9.6"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -43,7 +42,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "2.0.x-dev"
}
}
}
5 changes: 0 additions & 5 deletions phpspec.yml.dist

This file was deleted.

18 changes: 6 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true"
>
cacheResult="false"
failOnWarning="true"
failOnRisky="true">
<testsuites>
<testsuite name="portphp/spreadsheet">
<directory suffix=".php">./tests/</directory>
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
Loading