src/Cortex/Tags/Bot.php
public function parse($source, Input $input)
    {
        if (! $this->sourceAllowed()) {
            return $source;
        }

        if ($this->hasMatches($source)) {
            $matches   = $this->getMatches($source);
            $variables = synapse()->memory->variables();

            foreach ($matches as $match) {
                $source = str_replace($match[0], $variables[$match[1]], $source);
            }
        }

        return $source;
    }
public function parse($source, Input $input)
    {
        if (! $this->sourceAllowed()) {
            return $source;
        }

        if ($this->hasMatches($source)) {
            $matches   = $this->getMatches($source);
            $variables = synapse()->memory->variables();

            foreach ($matches as $match) {
                $source = str_replace($match[0], $variables[$match[1]], $source);
            }
        }

        return $source;
    }
public function parse ( $ source , Input $ input ) { if ( ! $ this -> sourceAllowed ( ) ) { return $ source ; } if ( $ this -> hasMatches ( $ source ) ) { $ matches = $ this -> getMatches ( $ source ) ; $ variables = synapse ( ) -> memory -> variables ( ) ; foreach ( $ matches as $ match ) { $ source = str_replace ( $ match [ 0 ] , $ variables [ $ match [ 1 ] ] , $ source ) ; } } return $ source ; }
Parse the source.

@param string $source

@return string
Parse the source .