price = $price; $this->priceThreshold = $priceThreshold; $this->stock = $stock; $this->stockThreshold = $stockThreshold; $this->link = $link; } /** * @inheritDoc */ public function toMarkdownString(): string { return "Le prix des Robux sur Eldorado est actuellement de **" . $this->floatFormat($this->price) . " €**/Robux, ce qui est inférieur ou égal au seuil de **" . $this->floatFormat($this->priceThreshold) . " €**.\nLe stock est de **" . $this->intFormat($this->stock) . "**" . ($this->stockThreshold !== null ? " (seuil : **" . $this->intFormat($this->stockThreshold) . "**)" : "") . "\n[Voir l'offre sur Eldorado]( " . $this->link . " )"; } /** * @inheritDoc */ public function toString(): string { return "Le prix des Robux sur Eldorado est actuellement de " . $this->floatFormat($this->price) . " €/Robux, ce qui est inférieur ou égal au seuil de " . $this->floatFormat($this->priceThreshold) . " €.\nLe stock est de " . $this->intFormat($this->stock) . ($this->stockThreshold !== null ? " (seuil : " . $this->intFormat($this->stockThreshold) . ")" : "") . "\nVoir l'offre sur Eldorado : " . $this->link; } private function floatFormat(float $number): string { return number_format($number, 5, ",", " "); } private function intFormat(int $number): string { return number_format($number, 0, ",", " "); } }