Drop PHP 7.2

This is according to our formal, published, policy to only support
eol PHP after 6 months.

See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
This commit is contained in:
Adrien Crivelli 2021-11-01 11:40:41 +09:00
parent 4c4ae2634f
commit 858e073063
8 changed files with 35 additions and 49 deletions

View File

@ -8,7 +8,6 @@ jobs:
experimental: experimental:
- false - false
php-version: php-version:
- '7.2'
- '7.3' - '7.3'
- '7.4' - '7.4'
- '8.0' - '8.0'
@ -150,7 +149,7 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Code Version Compatibility check with PHP_CodeSniffer - name: Code Version Compatibility check with PHP_CodeSniffer
run: ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 7.2- run: ./vendor/bin/phpcs -q --report-width=200 --report=summary,full src/ --standard=PHPCompatibility --runtime-set testVersion 7.3-
phpstan: phpstan:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
### Changed ### Changed
- Nothing - Drop support for PHP 7.2, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
### Deprecated ### Deprecated

View File

@ -48,11 +48,11 @@
"php-cs-fixer fix --ansi" "php-cs-fixer fix --ansi"
], ],
"versions": [ "versions": [
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.2- -n" "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.3- -n"
] ]
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^7.3 || ^8.0",
"ext-ctype": "*", "ext-ctype": "*",
"ext-dom": "*", "ext-dom": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",

40
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "08bcc40376dc4b219b21d172e40c622d", "content-hash": "4474427c6ded1acc044ea945792e7fb5",
"packages": [ "packages": [
{ {
"name": "ezyang/htmlpurifier", "name": "ezyang/htmlpurifier",
@ -240,26 +240,26 @@
}, },
{ {
"name": "myclabs/php-enum", "name": "myclabs/php-enum",
"version": "1.7.7", "version": "1.8.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/php-enum.git", "url": "https://github.com/myclabs/php-enum.git",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7" "reference": "b942d263c641ddb5190929ff840c68f78713e937"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7", "reference": "b942d263c641ddb5190929ff840c68f78713e937",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"php": ">=7.1" "php": "^7.3 || ^8.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7", "phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "1.*", "squizlabs/php_codesniffer": "1.*",
"vimeo/psalm": "^3.8" "vimeo/psalm": "^4.6.2"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -284,7 +284,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/myclabs/php-enum/issues", "issues": "https://github.com/myclabs/php-enum/issues",
"source": "https://github.com/myclabs/php-enum/tree/1.7.7" "source": "https://github.com/myclabs/php-enum/tree/1.8.3"
}, },
"funding": [ "funding": [
{ {
@ -296,7 +296,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-11-14T18:14:52+00:00" "time": "2021-07-05T08:18:36+00:00"
}, },
{ {
"name": "psr/http-client", "name": "psr/http-client",
@ -2334,29 +2334,29 @@
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "3.1.3", "version": "4.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "9c1da83261628cb24b6a6df371b6e312b3954768" "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3",
"reference": "9c1da83261628cb24b6a6df371b6e312b3954768", "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
"php": ">=7.1" "php": "^7.3 || ^8.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^9.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1-dev" "dev-master": "4.0-dev"
} }
}, },
"autoload": { "autoload": {
@ -2381,7 +2381,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues", "issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
}, },
"funding": [ "funding": [
{ {
@ -2390,7 +2390,7 @@
} }
], ],
"abandoned": true, "abandoned": true,
"time": "2021-07-26T12:15:06+00:00" "time": "2020-08-04T08:28:15+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@ -5141,7 +5141,7 @@
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^7.2 || ^8.0", "php": "^7.3 || ^8.0",
"ext-ctype": "*", "ext-ctype": "*",
"ext-dom": "*", "ext-dom": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",

View File

@ -24,7 +24,7 @@ allow you to read and write various spreadsheet file formats such as Excel and L
## Software requirements ## Software requirements
PHP version 7.2 or newer to develop using PhpSpreadsheet. Other requirements, such as PHP extensions, are enforced by PHP version 7.3 or newer to develop using PhpSpreadsheet. Other requirements, such as PHP extensions, are enforced by
composer. See the `require` section of [the composer.json file](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/composer.json) composer. See the `require` section of [the composer.json file](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/composer.json)
for details. for details.

View File

@ -3,7 +3,7 @@
require_once 'Header.php'; require_once 'Header.php';
$requirements = [ $requirements = [
'PHP 7.2.0' => version_compare(PHP_VERSION, '7.2.0', '>='), 'PHP 7.3.0' => version_compare(PHP_VERSION, '7.3.0', '>='),
'PHP extension XML' => extension_loaded('xml'), 'PHP extension XML' => extension_loaded('xml'),
'PHP extension xmlwriter' => extension_loaded('xmlwriter'), 'PHP extension xmlwriter' => extension_loaded('xmlwriter'),
'PHP extension mbstring' => extension_loaded('mbstring'), 'PHP extension mbstring' => extension_loaded('mbstring'),

View File

@ -3,7 +3,6 @@
namespace PhpOffice\PhpSpreadsheet\Reader\Security; namespace PhpOffice\PhpSpreadsheet\Reader\Security;
use PhpOffice\PhpSpreadsheet\Reader; use PhpOffice\PhpSpreadsheet\Reader;
use PhpOffice\PhpSpreadsheet\Settings;
class XmlScanner class XmlScanner
{ {
@ -71,7 +70,7 @@ class XmlScanner
private function disableEntityLoaderCheck(): void private function disableEntityLoaderCheck(): void
{ {
if (Settings::getLibXmlDisableEntityLoader() && \PHP_VERSION_ID < 80000) { if (\PHP_VERSION_ID < 80000) {
$libxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true); $libxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true);
if (self::$libxmlDisableEntityLoaderValue === null) { if (self::$libxmlDisableEntityLoaderValue === null) {

View File

@ -26,17 +26,6 @@ class Settings
*/ */
private static $libXmlLoaderOptions; private static $libXmlLoaderOptions;
/**
* Allow/disallow libxml_disable_entity_loader() call when not thread safe.
* Default behaviour is to do the check, but if you're running PHP versions
* 7.2 < 7.2.1
* then you may need to disable this check to prevent unwanted behaviour in other threads
* SECURITY WARNING: Changing this flag is not recommended.
*
* @var bool
*/
private static $libXmlDisableEntityLoader = true;
/** /**
* The cache implementation to be used for cell collection. * The cache implementation to be used for cell collection.
* *
@ -135,28 +124,27 @@ class Settings
} }
/** /**
* Enable/Disable the entity loader for libxml loader. * Deprecated, has no effect.
* Allow/disallow libxml_disable_entity_loader() call when not thread safe.
* Default behaviour is to do the check, but if you're running PHP versions
* 7.2 < 7.2.1
* then you may need to disable this check to prevent unwanted behaviour in other threads
* SECURITY WARNING: Changing this flag to false is not recommended.
* *
* @param bool $state * @param bool $state
*
* @deprecated will be removed without replacement as it is no longer necessary on PHP 7.3.0+
*/ */
public static function setLibXmlDisableEntityLoader($state): void public static function setLibXmlDisableEntityLoader($state): void
{ {
self::$libXmlDisableEntityLoader = (bool) $state; // noop
} }
/** /**
* Return the state of the entity loader (disabled/enabled) for libxml loader. * Deprecated, has no effect.
* *
* @return bool $state * @return bool $state
*
* @deprecated will be removed without replacement as it is no longer necessary on PHP 7.3.0+
*/ */
public static function getLibXmlDisableEntityLoader(): bool public static function getLibXmlDisableEntityLoader(): bool
{ {
return self::$libXmlDisableEntityLoader; return true;
} }
/** /**