LightnCandy\LightnCandy::getContext PHP Method

getContext() public static method

Get last compiler context.
public static getContext ( ) : array\arraystring | integer>
return array\arraystring | integer>
    public static function getContext()
    {
        return static::$lastContext;
    }

Usage Example

 /**
  * @dataProvider issueProvider
  */
 public function testIssues($issue)
 {
     global $tmpdir;
     $php = LightnCandy::compile($issue['template'], isset($issue['options']) ? $issue['options'] : null);
     $context = LightnCandy::getContext();
     $parsed = print_r(LightnCandy::$lastParsed, true);
     if (count($context['error'])) {
         $this->fail('Compile failed due to:' . print_r($context['error'], true) . "\nPARSED: {$parsed}");
     }
     $renderer = LightnCandy::prepare($php);
     $this->assertEquals($issue['expected'], $renderer($issue['data'], array('debug' => $issue['debug'])), "PHP CODE:\n{$php}\n{$parsed}");
 }
All Usage Examples Of LightnCandy\LightnCandy::getContext