Parser.php
protected function findPlaceholders()
    {
        $data = array();

        foreach ($this->data as $part) {
            if (is_string($part)) {
                while (preg_match('#^(.+){{([^}]+)}}(.+)$#Usi', $part, $match)) {
                    $data[] = $match[1];
                    $placeholder = new Placeholder($match[2]);
                    $data[] = $placeholder;
                    $this->placeholders[$placeholder->getName()] = $placeholder;
                    $part = $match[3];
                }
                $data[] = $part;
            } else {
                $data[] = $part;
            }
        }

        $this->data = $data;
    }
protected function findPlaceholders()
    {
        $data = array();

        foreach ($this->data as $part) {
            if (is_string($part)) {
                while (preg_match('#^(.+){{([^}]+)}}(.+)$#Usi', $part, $match)) {
                    $data[] = $match[1];
                    $placeholder = new Placeholder($match[2]);
                    $data[] = $placeholder;
                    $this->placeholders[$placeholder->getName()] = $placeholder;
                    $part = $match[3];
                }
                $data[] = $part;
            } else {
                $data[] = $part;
            }
        }

        $this->data = $data;
    }
protected function findPlaceholders ( ) { $ data = array ( ) ; foreach ( $ this -> data as $ part ) { if ( is_string ( $ part ) ) { while ( preg_match ( '#^(.+){{([^}]+)}}(.+)$#Usi' , $ part , $ match ) ) { $ data [ ] = $ match [ 1 ] ; $ placeholder = new Placeholder ( $ match [ 2 ] ) ; $ data [ ] = $ placeholder ; $ this -> placeholders [ $ placeholder -> getName ( ) ] = $ placeholder ; $ part = $ match [ 3 ] ; } $ data [ ] = $ part ; } else { $ data [ ] = $ part ; } } $ this -> data = $ data ; }
Parsing second pass, finding placeholders in strings
Parsing second pass finding placeholders in strings