I want to write function in class. I want to run this function only if one variable is not set. I have 3 thoughts about this, but I do not know which one is best and looks "more professional".
1:
if (!isset($this->variable) {
$this->functionXxx();
}
2:
private function functionXxx()
{
if (!isset($this->variable)) {
//code here
}
}
3:
private function functionXxx()
{
if (isset($this->variable)) {
return;
}
//code here
}