<pman>Intégration de la branche rel82-0.5.0

This commit is contained in:
Jephté Clain 2025-04-30 04:43:21 +04:00
commit 32fbed599e
7 changed files with 102 additions and 205 deletions

View File

@ -9,4 +9,4 @@ composer:
dist:
link: false
require:
nulib/php: ^0.4.0p82
nulib/php: ^0.5.0p82

2
.idea/nulib-spout.iml generated
View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="nulib\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="nulib\ext\" />
<sourceFolder url="file://$MODULE_DIR$/upstream-3.x/src" isTestSource="false" packagePrefix="OpenSpout\" />
<sourceFolder url="file://$MODULE_DIR$/openspout3/src" isTestSource="false" packagePrefix="OpenSpout\" />
<excludeFolder url="file://$MODULE_DIR$/vendor" />
</content>
<orderEntry type="inheritedJdk" />

View File

@ -1,3 +1,10 @@
## Release 0.5.0p82 du 30/04/2025-04:43
## Release 0.5.0p74 du 30/04/2025-04:39
* `6c1c85b` remplacer nur_func par func
* `3cdcf49` support de multiples définitions pour border
## Release 0.4.0p82 du 14/03/2025-15:40
## Release 0.4.0p74 du 14/03/2025-15:35

View File

@ -1 +1 @@
0.4.0
0.5.0

View File

@ -18,7 +18,7 @@
"openspout/openspout": "v4.27.0"
},
"require": {
"nulib/php": "^0.4.0p82",
"nulib/php": "^0.5.0p82",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-filter": "*",

244
composer.lock generated
View File

@ -4,15 +4,15 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b8cc65f204cb4f352f82d67135a72dc8",
"content-hash": "a52c55d2e232adab0d6e67b6b6358568",
"packages": [
{
"name": "nulib/php",
"version": "0.4.0p82",
"version": "0.5.0p82",
"source": {
"type": "git",
"url": "https://git.univ-reunion.fr/sda-php/nulib.git",
"reference": "fd120298a91bddcaa3da2decd34b8f99853fb070"
"reference": "9f8b6545e68079728bb7349487b99024bd7d5090"
},
"require": {
"ext-json": "*",
@ -22,6 +22,8 @@
"require-dev": {
"ext-curl": "*",
"ext-pcntl": "*",
"ext-pdo": "*",
"ext-pgsql": "*",
"ext-posix": "*",
"ext-sqlite3": "*",
"nulib/tests": "^8.2"
@ -50,7 +52,7 @@
}
],
"description": "fonctions et classes essentielles",
"time": "2025-03-14T11:24:39+00:00"
"time": "2025-04-30T00:33:36+00:00"
},
{
"name": "symfony/deprecation-contracts",
@ -200,16 +202,16 @@
},
{
"name": "symfony/yaml",
"version": "v7.2.3",
"version": "v7.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "ac238f173df0c9c1120f862d0f599e17535a87ec"
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/ac238f173df0c9c1120f862d0f599e17535a87ec",
"reference": "ac238f173df0c9c1120f862d0f599e17535a87ec",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"shasum": ""
},
"require": {
@ -252,7 +254,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v7.2.3"
"source": "https://github.com/symfony/yaml/tree/v7.2.5"
},
"funding": [
{
@ -268,7 +270,7 @@
"type": "tidelift"
}
],
"time": "2025-01-07T12:55:42+00:00"
"time": "2025-03-03T07:12:39+00:00"
}
],
"packages-dev": [
@ -913,16 +915,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.72.0",
"version": "v3.75.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "900389362c43d116fee1ffc51f7878145fa61b57"
"reference": "399a128ff2fdaf4281e4e79b755693286cdf325c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/900389362c43d116fee1ffc51f7878145fa61b57",
"reference": "900389362c43d116fee1ffc51f7878145fa61b57",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/399a128ff2fdaf4281e4e79b755693286cdf325c",
"reference": "399a128ff2fdaf4281e4e79b755693286cdf325c",
"shasum": ""
},
"require": {
@ -930,6 +932,7 @@
"composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3",
"ext-filter": "*",
"ext-hash": "*",
"ext-json": "*",
"ext-tokenizer": "*",
"fidry/cpu-core-counter": "^1.2",
@ -1004,7 +1007,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.72.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.75.0"
},
"funding": [
{
@ -1012,121 +1015,7 @@
"type": "github"
}
],
"time": "2025-03-13T11:25:37+00:00"
},
{
"name": "icecave/parity",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/icecave/parity.git",
"reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icecave/parity/zipball/4fe835483e0f89f0f96763c47cb9fdca26c24bdc",
"reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc",
"shasum": ""
},
"require": {
"icecave/repr": "^4",
"php": ">=7.3"
},
"require-dev": {
"eloquent/liberator": "^2",
"eloquent/phony": "^5",
"eloquent/phony-phpunit": "^7",
"friendsofphp/php-cs-fixer": "^2",
"phpunit/phpunit": "^9"
},
"type": "library",
"autoload": {
"psr-4": {
"Icecave\\Parity\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "James Harris",
"email": "mailjamesharris@gmail.com",
"homepage": "https://github.com/jmalloc"
}
],
"description": "A customizable deep comparison library.",
"homepage": "https://github.com/icecave/parity",
"keywords": [
"compare",
"comparison",
"equal",
"equality",
"greater",
"less",
"sort",
"sorting"
],
"support": {
"issues": "https://github.com/icecave/parity/issues",
"source": "https://github.com/icecave/parity/tree/3.0.1"
},
"time": "2021-02-04T05:51:24+00:00"
},
{
"name": "icecave/repr",
"version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/icecave/repr.git",
"reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icecave/repr/zipball/3dad35ee43394404ae0f1926d754e7b7820da8e4",
"reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"require-dev": {
"eloquent/phony-phpunit": "^6",
"friendsofphp/php-cs-fixer": "^2",
"phpunit/phpunit": "^8"
},
"type": "library",
"autoload": {
"psr-4": {
"Icecave\\Repr\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "James Harris",
"email": "mailjamesharris@gmail.com",
"homepage": "https://github.com/jmalloc"
}
],
"description": "A library for generating string representations of any value, inspired by Python's reprlib library.",
"homepage": "https://github.com/icecave/repr",
"keywords": [
"human",
"readable",
"repr",
"representation",
"string"
],
"support": {
"issues": "https://github.com/icecave/repr/issues",
"source": "https://github.com/icecave/repr/tree/4.0.0"
},
"time": "2020-08-25T02:05:11+00:00"
"time": "2025-03-31T18:40:42+00:00"
},
{
"name": "infection/abstract-testframework-adapter",
@ -1435,16 +1324,16 @@
},
{
"name": "infection/mutator",
"version": "0.4.0",
"version": "0.4.1",
"source": {
"type": "git",
"url": "https://github.com/infection/mutator.git",
"reference": "51d6d01a2357102030aee9d603063c4bad86b144"
"reference": "3c976d721b02b32f851ee4e15d553ef1e9186d1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/infection/mutator/zipball/51d6d01a2357102030aee9d603063c4bad86b144",
"reference": "51d6d01a2357102030aee9d603063c4bad86b144",
"url": "https://api.github.com/repos/infection/mutator/zipball/3c976d721b02b32f851ee4e15d553ef1e9186d1d",
"reference": "3c976d721b02b32f851ee4e15d553ef1e9186d1d",
"shasum": ""
},
"require": {
@ -1472,7 +1361,7 @@
"description": "Mutator interface to implement custom mutators (mutation operators) for Infection",
"support": {
"issues": "https://github.com/infection/mutator/issues",
"source": "https://github.com/infection/mutator/tree/0.4.0"
"source": "https://github.com/infection/mutator/tree/0.4.1"
},
"funding": [
{
@ -1484,25 +1373,24 @@
"type": "open_collective"
}
],
"time": "2024-05-14T22:39:59+00:00"
"time": "2025-04-29T08:19:52+00:00"
},
{
"name": "justinrainbow/json-schema",
"version": "6.2.1",
"version": "6.4.1",
"source": {
"type": "git",
"url": "https://github.com/jsonrainbow/json-schema.git",
"reference": "dff04e3c7c11451a6b4e30709e17c44526ebff73"
"reference": "35d262c94959571e8736db1e5c9bc36ab94ae900"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/dff04e3c7c11451a6b4e30709e17c44526ebff73",
"reference": "dff04e3c7c11451a6b4e30709e17c44526ebff73",
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/35d262c94959571e8736db1e5c9bc36ab94ae900",
"reference": "35d262c94959571e8736db1e5c9bc36ab94ae900",
"shasum": ""
},
"require": {
"ext-json": "*",
"icecave/parity": "^3.0",
"marc-mabe/php-enum": "^4.0",
"php": "^7.2 || ^8.0"
},
@ -1558,9 +1446,9 @@
],
"support": {
"issues": "https://github.com/jsonrainbow/json-schema/issues",
"source": "https://github.com/jsonrainbow/json-schema/tree/6.2.1"
"source": "https://github.com/jsonrainbow/json-schema/tree/6.4.1"
},
"time": "2025-03-06T21:27:10+00:00"
"time": "2025-04-04T13:08:07+00:00"
},
{
"name": "marc-mabe/php-enum",
@ -1637,16 +1525,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.13.0",
"version": "1.13.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414"
"reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c",
"reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c",
"shasum": ""
},
"require": {
@ -1685,7 +1573,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.1"
},
"funding": [
{
@ -1693,7 +1581,7 @@
"type": "tidelift"
}
],
"time": "2025-02-12T12:17:51+00:00"
"time": "2025-04-29T12:36:36+00:00"
},
{
"name": "nikic/php-parser",
@ -2138,16 +2026,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.12.21",
"version": "1.12.25",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "14276fdef70575106a3392a4ed553c06a984df28"
"reference": "e310849a19e02b8bfcbb63147f495d8f872dd96f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/14276fdef70575106a3392a4ed553c06a984df28",
"reference": "14276fdef70575106a3392a4ed553c06a984df28",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e310849a19e02b8bfcbb63147f495d8f872dd96f",
"reference": "e310849a19e02b8bfcbb63147f495d8f872dd96f",
"shasum": ""
},
"require": {
@ -2192,7 +2080,7 @@
"type": "github"
}
],
"time": "2025-03-09T09:24:50+00:00"
"time": "2025-04-27T12:20:45+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
@ -3447,16 +3335,16 @@
},
{
"name": "sanmai/later",
"version": "0.1.4",
"version": "0.1.5",
"source": {
"type": "git",
"url": "https://github.com/sanmai/later.git",
"reference": "e24c4304a4b1349c2a83151a692cec0c10579f60"
"reference": "cf5164557d19930295892094996f049ea12ba14d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sanmai/later/zipball/e24c4304a4b1349c2a83151a692cec0c10579f60",
"reference": "e24c4304a4b1349c2a83151a692cec0c10579f60",
"url": "https://api.github.com/repos/sanmai/later/zipball/cf5164557d19930295892094996f049ea12ba14d",
"reference": "cf5164557d19930295892094996f049ea12ba14d",
"shasum": ""
},
"require": {
@ -3499,7 +3387,7 @@
"description": "Later: deferred wrapper object",
"support": {
"issues": "https://github.com/sanmai/later/issues",
"source": "https://github.com/sanmai/later/tree/0.1.4"
"source": "https://github.com/sanmai/later/tree/0.1.5"
},
"funding": [
{
@ -3507,7 +3395,7 @@
"type": "github"
}
],
"time": "2023-10-24T00:25:28+00:00"
"time": "2024-12-06T02:36:26+00:00"
},
{
"name": "sanmai/pipeline",
@ -4556,16 +4444,16 @@
},
{
"name": "symfony/console",
"version": "v7.2.1",
"version": "v7.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3"
"reference": "e51498ea18570c062e7df29d05a7003585b19b88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88",
"reference": "e51498ea18570c062e7df29d05a7003585b19b88",
"shasum": ""
},
"require": {
@ -4629,7 +4517,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.2.1"
"source": "https://github.com/symfony/console/tree/v7.2.5"
},
"funding": [
{
@ -4645,7 +4533,7 @@
"type": "tidelift"
}
],
"time": "2024-12-11T03:49:26+00:00"
"time": "2025-03-12T08:11:12+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -5397,16 +5285,16 @@
},
{
"name": "symfony/process",
"version": "v7.2.4",
"version": "v7.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf"
"reference": "87b7c93e57df9d8e39a093d32587702380ff045d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf",
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf",
"url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d",
"reference": "87b7c93e57df9d8e39a093d32587702380ff045d",
"shasum": ""
},
"require": {
@ -5438,7 +5326,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.2.4"
"source": "https://github.com/symfony/process/tree/v7.2.5"
},
"funding": [
{
@ -5454,7 +5342,7 @@
"type": "tidelift"
}
],
"time": "2025-02-05T08:33:46+00:00"
"time": "2025-03-13T12:21:46+00:00"
},
{
"name": "symfony/service-contracts",
@ -5690,16 +5578,16 @@
},
{
"name": "thecodingmachine/safe",
"version": "v3.0.2",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/safe.git",
"reference": "22ffad3248982a784f9870a37aeb2e522bd19645"
"reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/22ffad3248982a784f9870a37aeb2e522bd19645",
"reference": "22ffad3248982a784f9870a37aeb2e522bd19645",
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/234f6fe34a0bead8c5ae1cfc0800539442e6f619",
"reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619",
"shasum": ""
},
"require": {
@ -5809,7 +5697,7 @@
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
"support": {
"issues": "https://github.com/thecodingmachine/safe/issues",
"source": "https://github.com/thecodingmachine/safe/tree/v3.0.2"
"source": "https://github.com/thecodingmachine/safe/tree/v3.1.1"
},
"funding": [
{
@ -5825,7 +5713,7 @@
"type": "github"
}
],
"time": "2025-02-19T19:23:00+00:00"
"time": "2025-04-28T07:56:17+00:00"
},
{
"name": "theseer/tokenizer",

View File

@ -6,7 +6,6 @@ use nulib\file\tab\AbstractBuilder;
use nulib\file\tab\TAbstractBuilder;
use nulib\os\path;
use nulib\php\func;
use nulib\php\nur_func;
use nulib\php\time\Date;
use nulib\php\time\DateTime;
use nulib\ref\ext\spout\ref_builder;
@ -95,20 +94,23 @@ class SpoutBuilder extends AbstractBuilder {
if (($rotation = $cell["rotation"] ?? null) !== null) $style->setTextRotation($rotation);
if (($format = $cell["format"] ?? null) !== null) $style->setFormat($format);
if (($border = $cell["border"] ?? null) !== null) {
if (is_string($border)) {
$parts = explode(" ", $border);
$border = [];
if (is_array($border)) $borderDefs = $border;
else $borderDefs = preg_split('/\s*,\s*/', trim(strval($border)));
$border = null;
foreach ($borderDefs as $borderDef) {
$parts = preg_split('/\s+/', $borderDef);
$borderDef = [];
$styleAll = null;
$widthAll = null;
$colorAll = null;
foreach ($parts as $part) {
if ($part === "all") {
$border["left"] = [];
$border["top"] = [];
$border["right"] = [];
$border["bottom"] = [];
$borderDef["left"] = [];
$borderDef["top"] = [];
$borderDef["right"] = [];
$borderDef["bottom"] = [];
} elseif (preg_match('/^(left|top|right|bottom)$/', $part)) {
$border[$part] = [];
$borderDef[$part] = [];
} elseif (preg_match('/^(none|solid|dashed|dotted|double)$/', $part)) {
$styleAll = $part;
} elseif (preg_match('/^(thin|medium|thick)$/', $part)) {
@ -117,18 +119,23 @@ class SpoutBuilder extends AbstractBuilder {
$colorAll = $part;
}
}
foreach ($border as &$part) {
foreach ($borderDef as &$part) {
if ($styleAll !== null) $part["style"] = $styleAll;
if ($widthAll !== null) $part["width"] = $widthAll;
if ($colorAll !== null) $part["color"] = $colorAll;
}; unset($part);
$top = $borderDef["top"] ?? null;
$right = $borderDef["right"] ?? null;
$bottom = $borderDef["bottom"] ?? null;
$left = $borderDef["left"] ?? null;
self::add_border_part($border, "top", $top);
self::add_border_part($border, "right", $right);
self::add_border_part($border, "bottom", $bottom);
self::add_border_part($border, "left", $left);
}
$parts = null;
self::add_border_part($parts, "top", $border["top"] ?? null);
self::add_border_part($parts, "right", $border["right"] ?? null);
self::add_border_part($parts, "bottom", $border["bottom"] ?? null);
self::add_border_part($parts, "left", $border["left"] ?? null);
if ($parts !== null) $style->setBorder(new Border(...$parts));
if ($border !== null) $style->setBorder(new Border(...$border));
}
if (($autofit = $cell["autofit"] ?? null) !== null) $style->setShouldShrinkToFit($autofit);
return $style;
@ -333,13 +340,8 @@ class SpoutBuilder extends AbstractBuilder {
}
if (array_key_exists("cook_func", $sheetParams)) {
$cookFunc = $sheetParams["cook_func"] ?? null;
$cookCtx = $cookArgs = null;
if ($cookFunc !== null) {
nur_func::ensure_func($cookFunc, $this, $cookArgs);
$cookCtx = nur_func::_prepare($cookFunc);
}
$this->cookCtx = $cookCtx;
$this->cookArgs = $cookArgs;
if ($cookFunc !== null) $cookFunc = func::with($cookFunc)->bind($this);
$this->cookFunc = $cookFunc;
}
}
return $this;