private function addElementByStage(
        $element,
        $stage
    ) {
        if (!isset($this->elementsStoredByStage[$stage])) {
            $this->elementsStoredByStage[$stage] = [];
        }

        $elementId = spl_object_hash($element);
        $this->elementsStoredByStage[$stage][$elementId] = $element;

        return $this;
    }
private function addElementByStage(
        $element,
        $stage
    ) {
        if (!isset($this->elementsStoredByStage[$stage])) {
            $this->elementsStoredByStage[$stage] = [];
        }

        $elementId = spl_object_hash($element);
        $this->elementsStoredByStage[$stage][$elementId] = $element;

        return $this;
    }
private function addElementByStage ( $ element , $ stage ) { if ( ! isset ( $ this -> elementsStoredByStage [ $ stage ] ) ) { $ this -> elementsStoredByStage [ $ stage ] = [ ] ; } $ elementId = spl_object_hash ( $ element ) ; $ this -> elementsStoredByStage [ $ stage ] [ $ elementId ] = $ element ; return $ this ; }
Add element by stage.

@param mixed  $element Element
@param string $stage   Stage

@return $this Self object
Add element by stage .