for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sketch;
use Sketch\Tpl\Engine;
/**
* Class Tpl
* @package Sketch
*/
class Tpl
{
* @var array
private static $assign = [];
* @var null
private static $engine = null;
* @return Engine
private static function engine(): Engine
if (!isset(self::$engine) || is_null(self::$engine)) {
self::$engine = new Engine;
new Sketch\Tpl\Engine()
Sketch\Tpl\Engine
null
$engine
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..
}
return self::$engine;
* @param array $config
* @throws \Exception
public static function config(array $config): void
self::engine()->config($config);
* @param string $key
* @param $value
public static function assign(string $key, $value): void
if (is_array($value)) {
$value = json_decode(json_encode($value), false);
self::$assign[$key] = $value;
* @param string $template
* @return string
public static function render(string $template): string
return self::engine()->render($template, self::$assign);
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..