protected function applyBehaviour(BehaviourInterface $behaviour, array $content = [])
    {
        if ($behaviour instanceof ExtendParent) {
            //We have to copy nodes from parent
            $this->nodes = $behaviour->getNode()->nodes;

            //Indication that this node has parent, meaning we have to handle blocks little
            //bit different way
            $this->extended = true;

            foreach ($behaviour->getAttributes() as $block => $blockContent) {
                $this->mountBlock($block, $blockContent);
            }

            return;
        }

        if ($behaviour instanceof CreateNode) {
            $this->mountBlock($behaviour->getName(), $content);

            return;
        }

        if ($behaviour instanceof ReplaceNode) {
            $this->nodes[] = $behaviour->createNode();
        }
    }
protected function applyBehaviour(BehaviourInterface $behaviour, array $content = [])
    {
        if ($behaviour instanceof ExtendParent) {
            //We have to copy nodes from parent
            $this->nodes = $behaviour->getNode()->nodes;

            //Indication that this node has parent, meaning we have to handle blocks little
            //bit different way
            $this->extended = true;

            foreach ($behaviour->getAttributes() as $block => $blockContent) {
                $this->mountBlock($block, $blockContent);
            }

            return;
        }

        if ($behaviour instanceof CreateNode) {
            $this->mountBlock($behaviour->getName(), $content);

            return;
        }

        if ($behaviour instanceof ReplaceNode) {
            $this->nodes[] = $behaviour->createNode();
        }
    }
protected function applyBehaviour ( BehaviourInterface $ behaviour , array $ content = [ ] ) { if ( $ behaviour instanceof ExtendParent ) { //We have to copy nodes from parent $ this -> nodes = $ behaviour -> getNode ( ) -> nodes ; //Indication that this node has parent, meaning we have to handle blocks little //bit different way $ this -> extended = true ; foreach ( $ behaviour -> getAttributes ( ) as $ block => $ blockContent ) { $ this -> mountBlock ( $ block , $ blockContent ) ; } return ; } if ( $ behaviour instanceof CreateNode ) { $ this -> mountBlock ( $ behaviour -> getName ( ) , $ content ) ; return ; } if ( $ behaviour instanceof ReplaceNode ) { $ this -> nodes [ ] = $ behaviour -> createNode ( ) ; } }
Once supervisor defined custom token behaviour we can process it's content accordingly.

@param BehaviourInterface $behaviour
@param array              $content
Once supervisor defined custom token behaviour we can process it s content accordingly .