Skip to content

Commit

Permalink
Fix incorrect or missing type annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Mar 25, 2014
1 parent 22a4745 commit f696e7a
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Mustache/Engine.php
Expand Up @@ -194,7 +194,7 @@ public function render($template, $context = array())
/**
* Get the current Mustache escape callback.
*
* @return mixed Callable or null
* @return callable|null
*/
public function getEscape()
{
Expand Down
7 changes: 7 additions & 0 deletions src/Mustache/Exception/SyntaxException.php
Expand Up @@ -16,12 +16,19 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta
{
protected $token;

/**
* @param string $msg
* @param array $token
*/
public function __construct($msg, array $token)
{
$this->token = $token;
parent::__construct($msg);
}

/**
* @return array
*/
public function getToken()
{
return $this->token;
Expand Down
3 changes: 3 additions & 0 deletions src/Mustache/Exception/UnknownFilterException.php
Expand Up @@ -16,6 +16,9 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
{
protected $filterName;

/**
* @param string $filterName
*/
public function __construct($filterName)
{
$this->filterName = $filterName;
Expand Down
3 changes: 3 additions & 0 deletions src/Mustache/Exception/UnknownHelperException.php
Expand Up @@ -16,6 +16,9 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
{
protected $helperName;

/**
* @param string $helperName
*/
public function __construct($helperName)
{
$this->helperName = $helperName;
Expand Down
3 changes: 3 additions & 0 deletions src/Mustache/Exception/UnknownTemplateException.php
Expand Up @@ -16,6 +16,9 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
{
protected $templateName;

/**
* @param string $templateName
*/
public function __construct($templateName)
{
$this->templateName = $templateName;
Expand Down
2 changes: 1 addition & 1 deletion src/Mustache/LambdaHelper.php
Expand Up @@ -38,7 +38,7 @@ public function __construct(Mustache_Engine $mustache, Mustache_Context $context
*
* @param string $string
*
* @return Rendered template.
* @return string Rendered template.
*/
public function render($string)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mustache/Loader/CascadingLoader.php
Expand Up @@ -25,7 +25,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader
* new Mustache_Loader_FilesystemLoader(__DIR__.'/templates')
* ));
*
* @param array $loaders An array of Mustache Loader instances
* @param Mustache_Loader[] $loaders An array of Mustache Loader instances
*/
public function __construct(array $loaders = array())
{
Expand Down
4 changes: 4 additions & 0 deletions src/Mustache/Loader/MutableLoader.php
Expand Up @@ -19,6 +19,8 @@ interface Mustache_Loader_MutableLoader
* Set an associative array of Template sources for this loader.
*
* @param array $templates
*
* @return void
*/
public function setTemplates(array $templates);

Expand All @@ -27,6 +29,8 @@ public function setTemplates(array $templates);
*
* @param string $name
* @param string $template Mustache Template source
*
* @return void
*/
public function setTemplate($name, $template);
}
4 changes: 2 additions & 2 deletions src/Mustache/Logger/StreamLogger.php
Expand Up @@ -37,8 +37,8 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
/**
* @throws InvalidArgumentException if the logging level is unknown.
*
* @param string $stream Resource instance or URL
* @param integer $level The minimum logging level at which this handler will be triggered
* @param resource|string $stream Resource instance or URL
* @param integer $level The minimum logging level at which this handler will be triggered
*/
public function __construct($stream, $level = Mustache_Logger::ERROR)
{
Expand Down
3 changes: 3 additions & 0 deletions test/Mustache/Test/Cache/FilesystemCacheTest.php
Expand Up @@ -44,6 +44,9 @@ public function testCachePut()
$this->assertTrue($loaded);
}

/**
* @param string $path
*/
private static function rmdir($path)
{
$path = rtrim($path, '/').'/';
Expand Down
3 changes: 3 additions & 0 deletions test/Mustache/Test/CompilerTest.php
Expand Up @@ -142,6 +142,9 @@ public function testCompilerThrowsSyntaxException()
$compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass');
}

/**
* @param string $value
*/
private function createTextToken($value)
{
return array(
Expand Down
3 changes: 3 additions & 0 deletions test/Mustache/Test/EngineTest.php
Expand Up @@ -349,6 +349,9 @@ public function testVerboseLoggingIsVerbose()
$this->assertContains("WARNING: Partial not found: \"bar\"", $log);
}

/**
* @param string $path
*/
private static function rmdir($path)
{
$path = rtrim($path, '/').'/';
Expand Down
3 changes: 2 additions & 1 deletion test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php
Expand Up @@ -78,7 +78,8 @@ private function prepareLambdasSpec($data)
*
* Loads YAML files from the spec and converts them to PHPisms.
*
* @access public
* @param string $name
*
* @return array
*/
private function loadSpec($name)
Expand Down
3 changes: 3 additions & 0 deletions test/Mustache/Test/Functional/HigherOrderSectionsTest.php
Expand Up @@ -112,6 +112,9 @@ public function wrapWithEm($text)
return sprintf('<em>%s</em>', $text);
}

/**
* @param string $text
*/
public function wrapWithStrong($text)
{
return sprintf('<strong>%s</strong>', $text);
Expand Down
3 changes: 2 additions & 1 deletion test/Mustache/Test/Functional/MustacheSpecTest.php
Expand Up @@ -132,7 +132,8 @@ public function loadSectionsSpec()
*
* Loads YAML files from the spec and converts them to PHPisms.
*
* @access public
* @param string $name
*
* @return array
*/
private function loadSpec($name)
Expand Down

0 comments on commit f696e7a

Please sign in to comment.