This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/lib/SymfonyTests/Components/Templating/ProjectTemplateDebugger.php

30 lines
572 B
PHP
Raw Normal View History

2010-01-04 14:26:20 +00:00
<?php
use Symfony\Components\Templating\DebuggerInterface;
class ProjectTemplateDebugger implements DebuggerInterface
{
protected $messages = array();
2010-01-04 14:26:20 +00:00
public function log($message)
2010-01-04 14:26:20 +00:00
{
$this->messages[] = $message;
2010-01-04 14:26:20 +00:00
}
public function hasMessage($regex)
{
foreach ($this->messages as $message) {
if (preg_match('#'.preg_quote($regex, '#').'#', $message)) {
return true;
}
}
return false;
}
2010-01-04 14:26:20 +00:00
public function getMessages()
{
return $this->messages;
}
2010-01-04 14:26:20 +00:00
}