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 attempting to access a view variable that is not defined
*
* @package Ingenerator\KohanaView\Exception
class UndefinedViewVarException extends \BadMethodCallException
{
* @param string $view_class
* @param string $var_name
* @return static
public static function forClassAndVar($view_class, $var_name)
return new static(
"$view_class does not define a '$var_name' field"
sprintf
$view_class
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);
$var_name
);
}
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.