I would like to know how to create a method in the interface of a program in object orientation, where this method receives parameters ... Example I am creating a remote control object where it has the function (method) to increase volume, but for I increase the volume I need to receive a value from the keyboard to increase the volume, I'm using PHP
interface Controlador {
public function ligar();
public function desligar();
public function aumentar_volume();
public function diminuir_volume();
public function abrir_menu();
}
Page of the class that implements the interface. I have only pasted the block with the function body, not the entire page.
public function aumentar_volume($valor){
if($this->getLigado(true)){
if($this->getVolume <= $this->getVolume_max){
$this->setVolume($this->$getVolume() + $this->getValor);
}else{
echo "Volume já atingiu o volume máximo";
}
}
}
Fatal error : Declaration of Remote_Control :: increase_volume () must be compatible with Controller :: increase_volume () in C: \ xampp \ htdocs \ Programs_Orientacao_Obj \ Remote_Control \ Remote_Controller.php on line 4