Fix incorrect or missing type annotations.

This commit is contained in:
Justin Hileman
2014-03-25 07:31:04 -07:00
parent 22a47452da
commit f696e7afa6
15 changed files with 41 additions and 7 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ class Mustache_Engine
/** /**
* Get the current Mustache escape callback. * Get the current Mustache escape callback.
* *
* @return mixed Callable or null * @return callable|null
*/ */
public function getEscape() public function getEscape()
{ {
@@ -16,12 +16,19 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta
{ {
protected $token; protected $token;
/**
* @param string $msg
* @param array $token
*/
public function __construct($msg, array $token) public function __construct($msg, array $token)
{ {
$this->token = $token; $this->token = $token;
parent::__construct($msg); parent::__construct($msg);
} }
/**
* @return array
*/
public function getToken() public function getToken()
{ {
return $this->token; return $this->token;
@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
{ {
protected $filterName; protected $filterName;
/**
* @param string $filterName
*/
public function __construct($filterName) public function __construct($filterName)
{ {
$this->filterName = $filterName; $this->filterName = $filterName;
@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
{ {
protected $helperName; protected $helperName;
/**
* @param string $helperName
*/
public function __construct($helperName) public function __construct($helperName)
{ {
$this->helperName = $helperName; $this->helperName = $helperName;
@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
{ {
protected $templateName; protected $templateName;
/**
* @param string $templateName
*/
public function __construct($templateName) public function __construct($templateName)
{ {
$this->templateName = $templateName; $this->templateName = $templateName;
+1 -1
View File
@@ -38,7 +38,7 @@ class Mustache_LambdaHelper
* *
* @param string $string * @param string $string
* *
* @return Rendered template. * @return string Rendered template.
*/ */
public function render($string) public function render($string)
{ {
+1 -1
View File
@@ -25,7 +25,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader
* new Mustache_Loader_FilesystemLoader(__DIR__.'/templates') * 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()) public function __construct(array $loaders = array())
{ {
+4
View File
@@ -19,6 +19,8 @@ interface Mustache_Loader_MutableLoader
* Set an associative array of Template sources for this loader. * Set an associative array of Template sources for this loader.
* *
* @param array $templates * @param array $templates
*
* @return void
*/ */
public function setTemplates(array $templates); public function setTemplates(array $templates);
@@ -27,6 +29,8 @@ interface Mustache_Loader_MutableLoader
* *
* @param string $name * @param string $name
* @param string $template Mustache Template source * @param string $template Mustache Template source
*
* @return void
*/ */
public function setTemplate($name, $template); public function setTemplate($name, $template);
} }
+1 -1
View File
@@ -37,7 +37,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
/** /**
* @throws InvalidArgumentException if the logging level is unknown. * @throws InvalidArgumentException if the logging level is unknown.
* *
* @param string $stream Resource instance or URL * @param resource|string $stream Resource instance or URL
* @param integer $level The minimum logging level at which this handler will be triggered * @param integer $level The minimum logging level at which this handler will be triggered
*/ */
public function __construct($stream, $level = Mustache_Logger::ERROR) public function __construct($stream, $level = Mustache_Logger::ERROR)
@@ -44,6 +44,9 @@ class Mustache_Test_Cache_FilesystemCacheTest extends PHPUnit_Framework_TestCase
$this->assertTrue($loaded); $this->assertTrue($loaded);
} }
/**
* @param string $path
*/
private static function rmdir($path) private static function rmdir($path)
{ {
$path = rtrim($path, '/').'/'; $path = rtrim($path, '/').'/';
+3
View File
@@ -142,6 +142,9 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
$compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass'); $compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass');
} }
/**
* @param string $value
*/
private function createTextToken($value) private function createTextToken($value)
{ {
return array( return array(
+3
View File
@@ -349,6 +349,9 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
$this->assertContains("WARNING: Partial not found: \"bar\"", $log); $this->assertContains("WARNING: Partial not found: \"bar\"", $log);
} }
/**
* @param string $path
*/
private static function rmdir($path) private static function rmdir($path)
{ {
$path = rtrim($path, '/').'/'; $path = rtrim($path, '/').'/';
@@ -78,7 +78,8 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew
* *
* Loads YAML files from the spec and converts them to PHPisms. * Loads YAML files from the spec and converts them to PHPisms.
* *
* @access public * @param string $name
*
* @return array * @return array
*/ */
private function loadSpec($name) private function loadSpec($name)
@@ -112,6 +112,9 @@ class Mustache_Test_Functional_Foo
return sprintf('<em>%s</em>', $text); return sprintf('<em>%s</em>', $text);
} }
/**
* @param string $text
*/
public function wrapWithStrong($text) public function wrapWithStrong($text)
{ {
return sprintf('<strong>%s</strong>', $text); return sprintf('<strong>%s</strong>', $text);
@@ -132,7 +132,8 @@ class Mustache_Test_Functional_MustacheSpecTest extends PHPUnit_Framework_TestCa
* *
* Loads YAML files from the spec and converts them to PHPisms. * Loads YAML files from the spec and converts them to PHPisms.
* *
* @access public * @param string $name
*
* @return array * @return array
*/ */
private function loadSpec($name) private function loadSpec($name)