diff --git a/.pman.yml b/.composer.pman.yml similarity index 88% rename from .pman.yml rename to .composer.pman.yml index 0786fbb..6c9491f 100644 --- a/.pman.yml +++ b/.composer.pman.yml @@ -9,4 +9,4 @@ composer: dist: link: false require: - nulib/php: ^0.4.0p74 + nulib/php: ^0.5.0p74 diff --git a/.idea/nulib-spout.iml b/.idea/nulib-spout.iml index 461be9e..8f2160d 100644 --- a/.idea/nulib-spout.iml +++ b/.idea/nulib-spout.iml @@ -4,7 +4,7 @@ - + diff --git a/CHANGES.md b/CHANGES.md index 3a24c49..56b0369 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +## 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 * `7e90311` tracer le hook diff --git a/VERSION.txt b/VERSION.txt index 1d0ba9e..8f0916f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.4.0 +0.5.0 diff --git a/composer.json b/composer.json index 1d0c13c..2c8395b 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "openspout/openspout": "v3.7.4" }, "require": { - "nulib/php": "^0.4.0p74", + "nulib/php": "^0.5.0p74", "ext-dom": "*", "ext-filter": "*", "ext-libxml": "*", diff --git a/composer.lock b/composer.lock index b088ee9..2b6478e 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "fa3bdcdf89054b7afba88c4ed3e09db4", + "content-hash": "fe6b4daee2e700fcdc3dc40c9ffe935d", "packages": [ { "name": "nulib/php", - "version": "0.4.0p74", + "version": "0.5.0p74", "source": { "type": "git", "url": "https://git.univ-reunion.fr/sda-php/nulib.git", - "reference": "559feda663fc99f8baee2ba32f164b19bdd01927" + "reference": "4037bf20424eb48708e5fdf9fc8e10f2ef71d134" }, "require": { "ext-json": "*", @@ -22,6 +22,8 @@ "require-dev": { "ext-curl": "*", "ext-pcntl": "*", + "ext-pdo": "*", + "ext-pgsql": "*", "ext-posix": "*", "ext-sqlite3": "*", "nulib/tests": "^7.4" @@ -50,7 +52,7 @@ } ], "description": "fonctions et classes essentielles", - "time": "2025-03-14T11:23:41+00:00" + "time": "2025-04-30T00:32:10+00:00" }, { "name": "symfony/deprecation-contracts", @@ -745,16 +747,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": { @@ -762,6 +764,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", @@ -836,7 +839,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": [ { @@ -844,20 +847,20 @@ "type": "github" } ], - "time": "2025-03-13T11:25:37+00:00" + "time": "2025-03-31T18:40:42+00:00" }, { "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": { @@ -896,7 +899,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": [ { @@ -904,7 +907,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", @@ -1122,16 +1125,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": { @@ -1176,7 +1179,7 @@ "type": "github" } ], - "time": "2025-03-09T09:24:50+00:00" + "time": "2025-04-27T12:20:45+00:00" }, { "name": "phpstan/phpstan-phpunit", diff --git a/src/ext/spout/SpoutBuilder.php b/src/ext/spout/SpoutBuilder.php index 5abdade..83ba5e1 100644 --- a/src/ext/spout/SpoutBuilder.php +++ b/src/ext/spout/SpoutBuilder.php @@ -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; @@ -86,20 +85,23 @@ class SpoutBuilder extends AbstractBuilder { if (($wrap = $cell["wrap"] ?? null) !== null) $style->setShouldWrapText($wrap); 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)) { @@ -108,22 +110,22 @@ 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 = $border["top"] ?? null; - $right = $border["right"] ?? null; - $bottom = $border["bottom"] ?? null; - $left = $border["left"] ?? null; - $border = 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); + $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); + } if ($border !== null) $style->setBorder($border); } return $style; @@ -321,13 +323,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;