From 71ca020b1efde802f0f958faf5c30374898f5166 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sat, 30 Nov 2024 05:59:20 +0400 Subject: [PATCH] =?UTF-8?q?suite=20param=C3=A8tres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/spout/ref_params.php | 22 +++++++++++++++++++++- src/spout/ref_params_ods.php | 19 ------------------- src/spout/ref_params_xlsx.php | 14 ++------------ 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/src/spout/ref_params.php b/src/spout/ref_params.php index 18fd189..c58f062 100644 --- a/src/spout/ref_params.php +++ b/src/spout/ref_params.php @@ -4,7 +4,27 @@ namespace nulib\ext\spout; use OpenSpout\Common\Entity\Style\Color; class ref_params { - public const COLORS = [ + const READER = [ + ]; + + const WRITER = [ + "->setColumnWidth" => ["float", ["int", null]], + "->setColumnWidthForRange" => ["int", "int", "int"], + "default_column_width" => "float", + "default_row_height" => "float", + "default_row_style" => self::STYLE, + ]; + + const SHEET = [ + "->setName" => ["string"], + "-setIsVisible" => ["bool"], + "header_style" => self::STYLE, + "odd_style" => self::STYLE, + "even_style" => self::STYLE, + "different_odd_even" => "bool", + ]; + + const COLORS = [ "black" => Color::BLACK, "white" => Color::WHITE, "red" => Color::RED, diff --git a/src/spout/ref_params_ods.php b/src/spout/ref_params_ods.php index 7430fc4..b0068e9 100644 --- a/src/spout/ref_params_ods.php +++ b/src/spout/ref_params_ods.php @@ -2,23 +2,4 @@ namespace nulib\ext\spout; class ref_params_ods extends ref_params { - const READER = [ - ]; - - const WRITER = [ - "->setColumnWidth" => ["float", ["int", null]], - "->setColumnWidthForRange" => ["int", "int", "int"], - "default_column_width" => "float", - "default_row_height" => "float", - "default_row_style" => self::STYLE, - ]; - - const SHEET = [ - "->setName" => ["string"], - "-setIsVisible" => ["bool"], - "header_style" => self::STYLE, - "odd_style" => self::STYLE, - "even_style" => self::STYLE, - "different_odd_even" => "bool", - ]; } diff --git a/src/spout/ref_params_xlsx.php b/src/spout/ref_params_xlsx.php index d7abaf8..86cf548 100644 --- a/src/spout/ref_params_xlsx.php +++ b/src/spout/ref_params_xlsx.php @@ -2,21 +2,11 @@ namespace nulib\ext\spout; class ref_params_xlsx extends ref_params { - const READER = [ - ]; - - const WRITER = [ - "->setColumnWidth" => ["float", ["int", null]], - "->setColumnWidthForRange" => ["int", "int", "int"], - "default_column_width" => "float", - "default_row_height" => "float", - "default_row_style" => self::STYLE, - ]; - const SHEET = [ + "view" => self::SHEET_VIEW, + # copie de parent::SHEET "->setName" => ["string"], "-setIsVisible" => ["bool"], - "view" => self::SHEET_VIEW, "header_style" => self::STYLE, "odd_style" => self::STYLE, "even_style" => self::STYLE,