Skip to content

Commit

Permalink
Use native type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Dec 11, 2024
1 parent feb4fb3 commit f7d173d
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 612 deletions.
8 changes: 4 additions & 4 deletions src/Handlebars/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function lastKey()
*
* @return mixed actual value
*/
public function with($variableName)
public function with(string $variableName)
{
$value = $this->get($variableName);
$this->push($value);
Expand All @@ -216,17 +216,17 @@ public function with($variableName)
}

/**
* Get a avariable from current context
* Get a variable from current context
* Supported types :
* variable , ../variable , variable.variable , .
*
* @param string $variableName variavle name to get from current context
* @param string $variableName variable name to get from current context
* @param boolean $strict strict search? if not found then throw exception
*
* @throws InvalidArgumentException in strict mode and variable not found
* @return mixed
*/
public function get($variableName, $strict = false)
public function get(string $variableName, bool $strict = false)
{
//Need to clean up
$variableName = trim($variableName);
Expand Down
Loading

0 comments on commit f7d173d

Please sign in to comment.