For example:
Case 1: Passing parameters through method
protected function _arrange_data($data, $sort) { ... }
Case 2: Get parameters in the method body
$this->_set_datas($data);
$this->_set_sort($sort);
protected function _arrange_data() {
$datas = $this->_get_datas();
$sort = $this->_get_sort();
}
Case 1: It look a little messy when a method need 4, 5 parameters. You need to get necessary data before call the method
Case 2: It look more clearly and no need to do anythings before call the method because method will get parameters itself. But I think this case will break "Dependency Injection" principle because it's not loose coupling and hard to maintenance
Question: Which solution do you prefer? Or if you have another way, please tell me. I am all ears.