From d4f20df3ea174a49a53056c8d1c00131eb6c6e78 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 28 Mar 2023 13:52:20 +0200 Subject: [PATCH 01/10] FIX : no usage of the function updateProduction in the update function --- htdocs/mrp/class/mo.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9c27a21b1f5..43b6adac644 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -612,11 +612,6 @@ class Mo extends CommonObject $error++; } - $result = $this->updateProduction($user, $notrigger); - if ($result <= 0) { - $error++; - } - if (!$error) { $this->db->commit(); return 1; From 805d457be11d32e62043bf67118f751902d71a19 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 3 Apr 2023 16:54:37 +0200 Subject: [PATCH 02/10] FIX : redesign of the function : updateProduction --- htdocs/mrp/class/mo.class.php | 99 ++++++----------------------------- htdocs/mrp/mo_card.php | 2 + 2 files changed, 19 insertions(+), 82 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 43b6adac644..7745d05d71a 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -631,93 +631,28 @@ class Mo extends CommonObject public function updateProduction(User $user, $notrigger = true) { $error = 0; - $role = ""; - if ($this->status != self::STATUS_DRAFT) { - //$this->error = 'BadStatusForUpdateProduction'; - //return -1; - return 1; - } + if ($this->status != self::STATUS_DRAFT) return 1; $this->db->begin(); - // Insert lines in mrp_production table from BOM data - if (!$error) { - // TODO Check that production has not started. If yes, we stop here. + $oldQty = $this->oldQty; + $newQty = $this->qty; + if($newQty != $oldQty) { + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; + $resql = $this->db->query($sql); + if($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $moLine = new MoLine($this->db); + $res = $moLine->fetch($obj->rowid); + if(!$res) $error++; - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.((int) $this->id); - $this->db->query($sql); - - $moline = new MoLine($this->db); - - // Line to produce - $moline->fk_mo = $this->id; - $moline->qty = $this->qty; - $moline->fk_product = $this->fk_product; - $moline->position = 1; - - if ($this->fk_bom > 0) { // If a BOM is defined, we know what to produce. - include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; - $bom = new Bom($this->db); - $bom->fetch($this->fk_bom); - if ($bom->bomtype == 1) { - $role = 'toproduce'; - $moline->role = 'toconsume'; - } else { - $role = 'toconsume'; - $moline->role = 'toproduce'; - } - } else { - if ($this->mrptype == 1) { - $moline->role = 'toconsume'; - } else { - $moline->role = 'toproduce'; - } - } - - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); - } - - if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. - if ($bom->id > 0) { - // Lines to consume - if (!$error) { - foreach ($bom->lines as $line) { - $moline = new MoLine($this->db); - - $moline->fk_mo = $this->id; - $moline->origin_id = $line->id; - $moline->origin_type = 'bomline'; - if ($line->qty_frozen) { - $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce - } else { - $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition - } - if ($moline->qty <= 0) { - $error++; - $this->error = "BadValueForquantityToConsume"; - break; - } else { - $moline->fk_product = $line->fk_product; - $moline->role = $role; - $moline->position = $line->position; - $moline->qty_frozen = $line->qty_frozen; - $moline->disable_stock_change = $line->disable_stock_change; - - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); - break; - } - } + if($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { + if (empty($moLine->qty_frozen)) { + $qty = $newQty * $moLine->qty / $oldQty; + $moLine->qty = price2num($qty * (!empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition + $res = $moLine->update($user); + if(!$res) $error++; } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index b3a4b3aced8..8a460056a13 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -123,6 +123,8 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); + $object->oldQty = $object->qty; + if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { From 700efad2355a6a2ecabc5a1d710c3477a165a8a9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 3 Apr 2023 15:00:40 +0000 Subject: [PATCH 03/10] Fixing style errors. --- htdocs/mrp/class/mo.class.php | 10 +++++----- htdocs/mrp/mo_card.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 7745d05d71a..8e0b94ccb5b 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -638,21 +638,21 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; - if($newQty != $oldQty) { + if ($newQty != $oldQty) { $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; $resql = $this->db->query($sql); - if($resql) { + if ($resql) { while ($obj = $this->db->fetch_object($resql)) { $moLine = new MoLine($this->db); $res = $moLine->fetch($obj->rowid); - if(!$res) $error++; + if (!$res) $error++; - if($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { + if ($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { if (empty($moLine->qty_frozen)) { $qty = $newQty * $moLine->qty / $oldQty; $moLine->qty = price2num($qty * (!empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition $res = $moLine->update($user); - if(!$res) $error++; + if (!$res) $error++; } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 8a460056a13..974e6eae4df 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -123,7 +123,7 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); - $object->oldQty = $object->qty; + $object->oldQty = $object->qty; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { From 2c90f7335ea26149688d21977372e76f87b52649 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 5 Apr 2023 11:42:50 +0200 Subject: [PATCH 04/10] FIX : Travis --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 7745d05d71a..97075ddd440 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -638,8 +638,8 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; - if($newQty != $oldQty) { - $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; + if($newQty != $oldQty && !empty($this->oldQty)) { + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . (int) $this->id; $resql = $this->db->query($sql); if($resql) { while ($obj = $this->db->fetch_object($resql)) { From 14560c1de818f45c86f82baac72aff2eb5931ba2 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 5 Apr 2023 15:37:35 +0200 Subject: [PATCH 05/10] FIX : Travis --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 5d971c0e440..ecb82507738 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -639,7 +639,7 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; if ($newQty != $oldQty && !empty($this->oldQty)) { - $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . (int) $this->id; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "mrp_production WHERE fk_mo = " . (int) $this->id; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { From 1410565b83a4a39cab1ffcbb5e7216275066125e Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Thu, 20 Apr 2023 19:55:31 +0200 Subject: [PATCH 06/10] Fix ref_client on Project Overview for propale The ref_customer in the propal object is name ref_client. I just added another check if nothing is found. --- htdocs/projet/element.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 1b002ba5688..23d72b18d4c 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1259,6 +1259,10 @@ foreach ($listofreferent as $key => $value) { if (!empty($element->ref_customer)) { print ' - '.$element->ref_customer; } + // Compatibility propale + if (empty($element->ref_customer) && !empty($element->ref_client)){ + print ' - '.$element->ref_client; + } } print "\n"; From 69f6685971630927b401ec6881b63daf0005c6d9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Apr 2023 18:23:40 +0000 Subject: [PATCH 07/10] Fixing style errors. --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23d72b18d4c..09f952cb631 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1260,7 +1260,7 @@ foreach ($listofreferent as $key => $value) { print ' - '.$element->ref_customer; } // Compatibility propale - if (empty($element->ref_customer) && !empty($element->ref_client)){ + if (empty($element->ref_customer) && !empty($element->ref_client)) { print ' - '.$element->ref_client; } } From 63a02083b87287602fbdf2d61d44477984ccbe09 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 24 Apr 2023 17:37:44 +0200 Subject: [PATCH 08/10] PHP8 compatibility --- htdocs/core/lib/bank.lib.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 2 +- .../includes/stripe/stripe-php/lib/Collection.php | 8 +++++--- .../stripe/stripe-php/lib/StripeObject.php | 12 ++++++------ .../stripe-php/lib/Util/CaseInsensitiveArray.php | 14 ++++++++------ htdocs/includes/stripe/stripe-php/lib/Util/Set.php | 3 ++- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 736b200bea3..4e8d9969c3c 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -318,7 +318,7 @@ function getIbanHumanReadable(Account $account) { if ($account->getCountryCode() == 'FR') { require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php'; - $ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', $account->iban); + $ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', empty($account->iban)?'':$account->iban); $iban = new PHP_IBAN\IBAN($ibantoprint); return $iban->HumanFormat(); } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 153773a6519..182f15b5aa5 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -414,7 +414,7 @@ if ($outputalsopricetotalwithtax) { if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { $situationinvoicelinewithparent = 0; - if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if (isset($line->fk_prev_id) && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice // Set constant to disallow editing during a situation cycle $situationinvoicelinewithparent = 1; diff --git a/htdocs/includes/stripe/stripe-php/lib/Collection.php b/htdocs/includes/stripe/stripe-php/lib/Collection.php index 899299d3dad..ab4536041d6 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Collection.php +++ b/htdocs/includes/stripe/stripe-php/lib/Collection.php @@ -2,6 +2,8 @@ namespace Stripe; +use Traversable; + /** * Class Collection. * @@ -47,7 +49,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate $this->filters = $filters; } - public function offsetGet($k) + public function offsetGet($k): mixed { if (\is_string($k)) { return parent::offsetGet($k); @@ -107,7 +109,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * @return int the number of objects in the current page */ - public function count() + public function count(): int { return \count($this->data); } @@ -116,7 +118,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @return \ArrayIterator an iterator that can be used to iterate * across objects in the current page */ - public function getIterator() + public function getIterator(): Traversable { return new \ArrayIterator($this->data); } diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php index eca01a00e90..8bb146138b1 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php @@ -194,28 +194,28 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } // ArrayAccess methods - public function offsetSet($k, $v) + public function offsetSet($k, $v): void { $this->{$k} = $v; } - public function offsetExists($k) + public function offsetExists($k): bool { return \array_key_exists($k, $this->_values); } - public function offsetUnset($k) + public function offsetUnset($k): void { unset($this->{$k}); } - public function offsetGet($k) + public function offsetGet($k): mixed { return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; } // Countable method - public function count() + public function count(): int { return \count($this->_values); } @@ -419,7 +419,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } } - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->toArray(); } diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index 670ab0b6a7e..c1aad379438 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -2,6 +2,8 @@ namespace Stripe\Util; +use Traversable; + /** * CaseInsensitiveArray is an array-like class that ignores case for keys. * @@ -21,17 +23,17 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega $this->container = \array_change_key_case($initial_array, \CASE_LOWER); } - public function count() + public function count(): int { return \count($this->container); } - public function getIterator() + public function getIterator(): Traversable { return new \ArrayIterator($this->container); } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $offset = static::maybeLowercase($offset); if (null === $offset) { @@ -41,20 +43,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega } } - public function offsetExists($offset) + public function offsetExists($offset): bool { $offset = static::maybeLowercase($offset); return isset($this->container[$offset]); } - public function offsetUnset($offset) + public function offsetUnset($offset): void { $offset = static::maybeLowercase($offset); unset($this->container[$offset]); } - public function offsetGet($offset) + public function offsetGet($offset): mixed { $offset = static::maybeLowercase($offset); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php index 017f9297856..54b363cd4b3 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php @@ -4,6 +4,7 @@ namespace Stripe\Util; use ArrayIterator; use IteratorAggregate; +use Traversable; class Set implements IteratorAggregate { @@ -37,7 +38,7 @@ class Set implements IteratorAggregate return \array_keys($this->_elts); } - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->toArray()); } From 847870f29f820f362c51ec84f548c721c020cc90 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 24 Apr 2023 18:07:44 +0200 Subject: [PATCH 09/10] more warning corrected --- htdocs/margin/agentMargins.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e68576edd81..c209fb1f957 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -347,6 +347,12 @@ if ($result) { } // Show total margin + if (!isset($cumul_achat)) { + $cumul_achat = 0; + } + if (!isset($cumul_vente)) { + $cumul_vente = 0; + } $totalMargin = $cumul_vente - $cumul_achat; $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; From ceb3ab077cf037bb95701d073e8dec820fa3b967 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Tue, 25 Apr 2023 09:37:03 +0200 Subject: [PATCH 10/10] remove includes from modification --- .../includes/stripe/stripe-php/lib/Collection.php | 8 +++----- .../stripe/stripe-php/lib/StripeObject.php | 12 ++++++------ .../stripe-php/lib/Util/CaseInsensitiveArray.php | 14 ++++++-------- htdocs/includes/stripe/stripe-php/lib/Util/Set.php | 3 +-- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/htdocs/includes/stripe/stripe-php/lib/Collection.php b/htdocs/includes/stripe/stripe-php/lib/Collection.php index ab4536041d6..899299d3dad 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Collection.php +++ b/htdocs/includes/stripe/stripe-php/lib/Collection.php @@ -2,8 +2,6 @@ namespace Stripe; -use Traversable; - /** * Class Collection. * @@ -49,7 +47,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate $this->filters = $filters; } - public function offsetGet($k): mixed + public function offsetGet($k) { if (\is_string($k)) { return parent::offsetGet($k); @@ -109,7 +107,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * @return int the number of objects in the current page */ - public function count(): int + public function count() { return \count($this->data); } @@ -118,7 +116,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @return \ArrayIterator an iterator that can be used to iterate * across objects in the current page */ - public function getIterator(): Traversable + public function getIterator() { return new \ArrayIterator($this->data); } diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php index 8bb146138b1..eca01a00e90 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php @@ -194,28 +194,28 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } // ArrayAccess methods - public function offsetSet($k, $v): void + public function offsetSet($k, $v) { $this->{$k} = $v; } - public function offsetExists($k): bool + public function offsetExists($k) { return \array_key_exists($k, $this->_values); } - public function offsetUnset($k): void + public function offsetUnset($k) { unset($this->{$k}); } - public function offsetGet($k): mixed + public function offsetGet($k) { return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; } // Countable method - public function count(): int + public function count() { return \count($this->_values); } @@ -419,7 +419,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } } - public function jsonSerialize(): mixed + public function jsonSerialize() { return $this->toArray(); } diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index c1aad379438..670ab0b6a7e 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -2,8 +2,6 @@ namespace Stripe\Util; -use Traversable; - /** * CaseInsensitiveArray is an array-like class that ignores case for keys. * @@ -23,17 +21,17 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega $this->container = \array_change_key_case($initial_array, \CASE_LOWER); } - public function count(): int + public function count() { return \count($this->container); } - public function getIterator(): Traversable + public function getIterator() { return new \ArrayIterator($this->container); } - public function offsetSet($offset, $value): void + public function offsetSet($offset, $value) { $offset = static::maybeLowercase($offset); if (null === $offset) { @@ -43,20 +41,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega } } - public function offsetExists($offset): bool + public function offsetExists($offset) { $offset = static::maybeLowercase($offset); return isset($this->container[$offset]); } - public function offsetUnset($offset): void + public function offsetUnset($offset) { $offset = static::maybeLowercase($offset); unset($this->container[$offset]); } - public function offsetGet($offset): mixed + public function offsetGet($offset) { $offset = static::maybeLowercase($offset); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php index 54b363cd4b3..017f9297856 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php @@ -4,7 +4,6 @@ namespace Stripe\Util; use ArrayIterator; use IteratorAggregate; -use Traversable; class Set implements IteratorAggregate { @@ -38,7 +37,7 @@ class Set implements IteratorAggregate return \array_keys($this->_elts); } - public function getIterator(): Traversable + public function getIterator() { return new ArrayIterator($this->toArray()); }