What will be considered "best practice" in this case. I have a class that collects remote resources, and it looks something like this:
class Gather {
public function getAll($locations) {
$results = array('All','My','Results');
return $results;
}
}
My question is, should I consider it best to return the results or assign them as a property? i.e.
$results = $gatherer->getAll();
$gatherer->getAll();
Most likely, I'm just overdoing it, but I don't have formal training, and I am wondering if there is a “more correct” way to do something like this.
source
share