public function __construct($expr, $explain) { $this->resId = getNextGlobalId(); $this->expr = $expr; $this->color = nextColor(); $this->explain = '<span style="background-color: #' . sprintf("%'06X", $this->color) . '" class="resource" data-resource-id="$this->resId">' . $explain . "</span>"; }
public function init(Context $context) { if ($this->inited) { throw new \RuntimeException("Already initialized"); } $this->inited = true; $this->context = $context; parent::__construct($context, getNextGlobalId()); }
/** * @param string $mainRef */ public function __construct($mainRef) { parent::__construct(new Context($mainRef), getNextGlobalId()); $_SESSION["executors"][$this->getId()] = $this; }
public function __construct(Context $parentCtx, BooleanResource $condition) { parent::__construct($parentCtx, getNextGlobalId()); $this->condition = $condition; $parentCtx->addChild($this->getContext()); }