anorgan / QuTee

PHP Background Jobs (Tasks) Manager
GNU Lesser General Public License v2.1
72 stars 12 forks source link

Provide method name to TaskInterface #20

Open m-hume opened 7 years ago

m-hume commented 7 years ago

allows for the task object to take the form

class myTask implements TaskInterface {
    protected $_data;
    public function run($methodName='')
    {
        if(method_exists($this, $methodName)){
            return call_user_func_array(array($this, $methodName), $this->_data);
        }
        return false;
    }

    public function setData(array $data)
    {
        $this->_data = $data;
    }

    protected function myMethodThatReceivesTheDataSetAsParameters($param1, $param2)
    {
        echo "$param1 \n";
        echo "$param2 \n";
    }
}
coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 56.604% when pulling 0ef98516b843e4b6f8a3b5ca2950db9189132609 on m-hume:patch-2 into 144777bab9047b807db1fc270fb21d687235e48b on anorgan:master.