What would be considered "best practice" in this case. I've got a class that's gathering remote resources, and it looks a bit like this:
class Gather {
public function getAll($locations) {
$results = array('All','My','Results');
return $results;
}
}
My question is, would it be considered a best practice to return the results, or to assign them as a property? ie.
// This
$results = $gatherer->getAll();
// vs This
$gatherer->getAll(); // now $gatherer->results can be used
Its quite likely I'm just overthinking this, but I've got no formal training and I'm wondering if there's "more correct" way of doing something like this.