for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Germania\Renderer;
use \Psr\Log\LoggerInterface;
use \Psr\Log\LoggerAwareTrait;
use \Psr\Log\LoggerAwareInterface;
use \Psr\Log\NullLogger;
class SmartyRenderer implements RendererInterface, LoggerAwareInterface {
use LoggerAwareTrait;
/**
* @var Smarty
*/
public $smarty;
* @param \Smarty $smarty Your Smarty instance
* @param LoggerInterface|null $logger Optional: PSR-3 Logger
public function __construct (\Smarty $smarty, LoggerInterface $logger = null )
{
$this->smarty = $smarty;
$smarty
object<Smarty>
object<Germania\Renderer\Smarty>
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->setLogger( $logger ?: new NullLogger );
}
* {@inheritDoc }
public function __invoke( $template, array $context = array())
$this->logger->info("Render Smarty template: " . $template, [
'context' => $context
]);
$this->logger->debug("Create template object");
$tpl = $this->smarty->createTemplate( $template, $this->smarty );
$this->logger->debug("Assign context variables");
$tpl->assign( $context );
$this->logger->info("Return template output");
return $this->smarty->fetch($tpl);
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..