4 use Robo\Common\BuilderAwareTrait;
11 * Provides the collection builder with access to all of the
12 * protected 'task' methods available on this object.
17 * @return null|\Robo\Collection\CollectionBuilder
19 public function getBuiltTask($fn, $args)
21 if (preg_match('#^task[A-Z]#', $fn)) {
22 return call_user_func_array([$this, $fn], $args);
27 * Alternative access to instantiate. Use:
29 * $this->task(Foo::class, $a, $b);
33 * $this->taskFoo($a, $b);
35 * The later form is preferred.
37 * @return \Robo\Collection\CollectionBuilder
39 protected function task()
41 $args = func_get_args();
42 $name = array_shift($args);
44 $collectionBuilder = $this->collectionBuilder();
45 return $collectionBuilder->build($name, $args);