This commit is contained in:
Jun Pataleta
2025-03-19 16:44:42 +08:00
7 changed files with 16 additions and 13 deletions
+4 -1
View File
@@ -25,4 +25,7 @@ This can be achieved by:
https://github.com/bobthecow/mustache.php/pull/402/commits/db771014c7e346438f68077813ebdda3fdae12df.patch
b) In terminal, navigate to lib/mustache/src/Mustache
c) Run the following: patch --directory . < ~/path/to/patch.patch
d) We do not need the unit test, so run rm DisableLambdaRenderingTest.php
d) We do not need the unit test, so run rm DisableLambdaRenderingTest.php
2) Apply local changes to ensure that all nullable method parameters are correctly type-hinted.
These can be detected using:
phpcs --sniffs=PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam lib/mustache
+2 -2
View File
@@ -731,11 +731,11 @@ class Mustache_Engine
* @see Mustache_Engine::loadLambda
*
* @param string|Mustache_Source $source
* @param Mustache_Cache $cache (default: null)
* @param ?Mustache_Cache $cache (default: null)
*
* @return Mustache_Template
*/
private function loadSource($source, Mustache_Cache $cache = null)
private function loadSource($source, ?Mustache_Cache $cache = null)
{
$className = $this->getTemplateClassName($source);
@@ -19,9 +19,9 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta
/**
* @param string $msg
* @param array $token
* @param Exception $previous
* @param ?Exception $previous
*/
public function __construct($msg, array $token, Exception $previous = null)
public function __construct($msg, array $token, ?Exception $previous = null)
{
$this->token = $token;
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
@@ -18,9 +18,9 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
/**
* @param string $filterName
* @param Exception $previous
* @param ?Exception $previous
*/
public function __construct($filterName, Exception $previous = null)
public function __construct($filterName, ?Exception $previous = null)
{
$this->filterName = $filterName;
$message = sprintf('Unknown filter: %s', $filterName);
@@ -18,9 +18,9 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
/**
* @param string $helperName
* @param Exception $previous
* @param ?Exception $previous
*/
public function __construct($helperName, Exception $previous = null)
public function __construct($helperName, ?Exception $previous = null)
{
$this->helperName = $helperName;
$message = sprintf('Unknown helper: %s', $helperName);
@@ -18,9 +18,9 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
/**
* @param string $templateName
* @param Exception $previous
* @param ?Exception $previous
*/
public function __construct($templateName, Exception $previous = null)
public function __construct($templateName, ?Exception $previous = null)
{
$this->templateName = $templateName;
$message = sprintf('Unknown template: %s', $templateName);
+2 -2
View File
@@ -66,11 +66,11 @@ class Mustache_Parser
* @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered
*
* @param array &$tokens Set of Mustache tokens
* @param array $parent Parent token (default: null)
* @param ?array $parent Parent token (default: null)
*
* @return array Mustache Token parse tree
*/
private function buildTree(array &$tokens, array $parent = null)
private function buildTree(array &$tokens, ?array $parent = null)
{
$nodes = array();