Skip to content

Conversation

@m-hume
Copy link
Contributor

@m-hume m-hume commented Feb 16, 2017

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";
    }
}

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
Copy link

coveralls commented Feb 16, 2017

Coverage Status

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants