*/ trait ChildTaskAwareTrait { private $children = []; /** * @param string $taskId * @return $this */ public function addChildId($taskId) { if (in_array($taskId, $this->children)) { throw new \InvalidArgumentException('Child ' . $taskId . ' has been added.'); } $this->children[] = $taskId; return $this; } /** * @return bool */ public function hasChildren() { return !empty($this->children); } /** * @return array */ public function getChildren() { return $this->children; } }