From 84fb498ee46b565e36ea899fa3e813bc2ac007e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 May 2024 21:13:10 +0200 Subject: [PATCH] Fix phan --- htdocs/core/class/commonobject.class.php | 8 ++++---- htdocs/stripe/class/stripe.class.php | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cac27904b8c..90b350b3f32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -350,10 +350,10 @@ abstract class CommonObject public $statut; /** - * @var int|array The object's status (an int). - * Or an array listing all the potential status of the object: - * array: int of the status => translated label of the status - * See for example the Account class. + * @var int|array The object's status (an int). + * Or an array listing all the potential status of the object: + * array: int of the status => translated label of the status + * See for example the Account class. * @see setStatut() */ public $status; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index f483787068d..6bdf7a861f0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This set stripe global e /** * Stripe class + * @TODO No reason to extends CommonObject */ class Stripe extends CommonObject { @@ -63,8 +64,12 @@ class Stripe extends CommonObject /** * @var string */ - public $statut; + // @phan-suppress-next-line + public $status; + /** + * @var string + */ public $type; /** @@ -1141,7 +1146,7 @@ class Stripe extends CommonObject /** * Create charge. - * This is called by page htdocs/stripe/payment.php and may be deprecated. + * This was called by page htdocs/stripe/payment.php and may be deprecated. * * @param int $amount Amount to pay * @param string $currency EUR, GPB... @@ -1154,6 +1159,7 @@ class Stripe extends CommonObject * @param int $usethirdpartyemailforreceiptemail Use thirdparty email as receipt email * @param boolean $capture Set capture flag to true (take payment) or false (wait) * @return Stripe + * @deprecated */ public function createPaymentStripe($amount, $currency, $origin, $item, $source, $customer, $account, $status = 0, $usethirdpartyemailforreceiptemail = 0, $capture = true) { @@ -1351,7 +1357,7 @@ class Stripe extends CommonObject if (isset($charge->id)) { } - $return->statut = 'success'; + $return->status = 'success'; $return->id = $charge->id; if (preg_match('/pm_/i', $source)) { @@ -1375,7 +1381,7 @@ class Stripe extends CommonObject $body = $e->getJsonBody(); $err = $body['error']; - $return->statut = 'error'; + $return->status = 'error'; $return->id = $err['charge']; $return->type = $err['type']; $return->code = $err['code'];