for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Andrew Coulton <[email protected]>
* @copyright 2015 inGenerator Ltd
* @license http://kohanaframework.org/license
*/
namespace Ingenerator\KohanaView\Exception;
* Thrown when the content of a template is not valid for some reason
*
* @package Ingenerator\KohanaView\Exception
class InvalidTemplateContentException extends \InvalidArgumentException
{
* @param string $escape_method
* @param string $source_fragment
* @return static
public static function containsImplicitDoubleEscape($escape_method, $source_fragment)
return new static(
"Invalid implicit double-escape in template - remove $escape_method from `$source_fragment` or mark as raw"
sprintf
$escape_method
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.
// Instead of $x = "foo $bar $baz"; // Better use either $x = "foo " . $bar . " " . $baz; $x = sprintf("foo %s %s", $bar, $baz);
$source_fragment
);
}
public static function forEmptyTemplate()
return new static('Cannot compile empty template');
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.