Corrction de la classe Enigme

ServeurDeTest
Johan LACHENAL 2 years ago
parent ca99c45b5e
commit c6f75c110f

@ -3,7 +3,6 @@
class Enigme class Enigme
{ {
private string $idEnigme; private string $idEnigme;
private string $admin;
private string $enonce; private string $enonce;
private string $aide; private string $aide;
private string $rappel; private string $rappel;
@ -13,7 +12,6 @@ class Enigme
/** /**
* @param string $idEnigme * @param string $idEnigme
* @param string $admin
* @param string $enonce * @param string $enonce
* @param string $aide * @param string $aide
* @param string $rappel * @param string $rappel
@ -21,17 +19,31 @@ class Enigme
* @param string $test * @param string $test
* @param int $tempsDeResolution * @param int $tempsDeResolution
*/ */
public function __construct(string $idEnigme, string $admin, string $enonce, string $aide, string $rappel, string $solution, string $test, int $tempsDeResolution) public function __construct(string $idEnigme, string $enonce, string $aide, string $rappel, string $solution, string $test, int $tempsDeResolution)
{ {
$this->idEnigme = $idEnigme; $arguments=func_get_args();
$this->admin = $admin; $index=func_num_args();
$this->enonce = $enonce; if(method_exists($this,$function='__construct'.$index));
$this->aide = $aide; call_user_func(array(array($this,$function),$arguments));
$this->rappel = $rappel; }
$this->solution = $solution;
$this->test = $test; public function __constructMulti(string $idEnigme, string $enonce, string $solution, string $test, int $tempsDeResolution){
$this->tempsDeResolution = $tempsDeResolution; $this->idEnigme=$idEnigme;
$this->enonce=$enonce;
$this->solution=$solution;
$this->test=$test;
$this->tempsDeResolution=$tempsDeResolution;
} }
public function __constructSolo(string $idEnigme, string $enonce, string $aide, string $rappel, string $solution, string $test){
$this->idEnigme=$idEnigme;
$this->enonce=$enonce;
$this->aide=$aide;
$this->rappel=$rappel;
$this->solution=$solution;
$this->test=$test;
}
/** /**
* @return string * @return string
*/ */
@ -48,22 +60,6 @@ class Enigme
$this->idEnigme = $idEnigme; $this->idEnigme = $idEnigme;
} }
/**
* @return string
*/
public function getAdmin(): string
{
return $this->admin;
}
/**
* @param string $admin
*/
public function setAdmin(string $admin): void
{
$this->admin = $admin;
}
/** /**
* @return string * @return string
*/ */

Loading…
Cancel
Save