I have the following code
public function create(){
return self::checkQuantity();
return self::checkSameLocation();
return self::someAnotherFunction();
return self::someMoreFunction();
..
..
..
}
public function checkQuantity(){
if(someCondition){
return [foo,bar];
}
}
public function checkSameLocation(){
if(someCondition){
return [foo,bar];
}
}
I would like to return function inside create()
only if it function inside it returns something else continue executing the create()
function.
Based on the example:
create()
gets called- if
checkQuantity
returns nothing then continue withcheckSameLocation()
without returningcheckQuantity()
function
NOTE: There could be multiple function calls inside create() sometimes, I would like to avoid using if statement
checks.