Pārlūkot izejas kodu

Fix incorrect or missing type annotations.

Justin Hileman 11 gadi atpakaļ
vecāks
revīzija
f696e7afa6

+ 1 - 1
src/Mustache/Engine.php

@@ -194,7 +194,7 @@ class Mustache_Engine
     /**
      * Get the current Mustache escape callback.
      *
-     * @return mixed Callable or null
+     * @return callable|null
      */
     public function getEscape()
     {

+ 7 - 0
src/Mustache/Exception/SyntaxException.php

@@ -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;

+ 3 - 0
src/Mustache/Exception/UnknownFilterException.php

@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
 {
     protected $filterName;
 
+    /**
+     * @param string $filterName
+     */
     public function __construct($filterName)
     {
         $this->filterName = $filterName;

+ 3 - 0
src/Mustache/Exception/UnknownHelperException.php

@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
 {
     protected $helperName;
 
+    /**
+     * @param string $helperName
+     */
     public function __construct($helperName)
     {
         $this->helperName = $helperName;

+ 3 - 0
src/Mustache/Exception/UnknownTemplateException.php

@@ -16,6 +16,9 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
 {
     protected $templateName;
 
+    /**
+     * @param string $templateName
+     */
     public function __construct($templateName)
     {
         $this->templateName = $templateName;

+ 1 - 1
src/Mustache/LambdaHelper.php

@@ -38,7 +38,7 @@ class Mustache_LambdaHelper
      *
      * @param string $string
      *
-     * @return Rendered template.
+     * @return string Rendered template.
      */
     public function render($string)
     {

+ 1 - 1
src/Mustache/Loader/CascadingLoader.php

@@ -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())
     {

+ 4 - 0
src/Mustache/Loader/MutableLoader.php

@@ -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);
 
@@ -27,6 +29,8 @@ interface Mustache_Loader_MutableLoader
      *
      * @param string $name
      * @param string $template Mustache Template source
+     *
+     * @return void
      */
     public function setTemplate($name, $template);
 }

+ 2 - 2
src/Mustache/Logger/StreamLogger.php

@@ -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)
     {

+ 3 - 0
test/Mustache/Test/Cache/FilesystemCacheTest.php

@@ -44,6 +44,9 @@ class Mustache_Test_Cache_FilesystemCacheTest extends PHPUnit_Framework_TestCase
         $this->assertTrue($loaded);
     }
 
+    /**
+     * @param string $path
+     */
     private static function rmdir($path)
     {
         $path = rtrim($path, '/').'/';

+ 3 - 0
test/Mustache/Test/CompilerTest.php

@@ -142,6 +142,9 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
         $compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass');
     }
 
+    /**
+     * @param string $value
+     */
     private function createTextToken($value)
     {
         return array(

+ 3 - 0
test/Mustache/Test/EngineTest.php

@@ -349,6 +349,9 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase
         $this->assertContains("WARNING: Partial not found: \"bar\"", $log);
     }
 
+    /**
+     * @param string $path
+     */
     private static function rmdir($path)
     {
         $path = rtrim($path, '/').'/';

+ 2 - 1
test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php

@@ -78,7 +78,8 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew
      *
      * Loads YAML files from the spec and converts them to PHPisms.
      *
-     * @access public
+     * @param string $name
+     *
      * @return array
      */
     private function loadSpec($name)

+ 3 - 0
test/Mustache/Test/Functional/HigherOrderSectionsTest.php

@@ -112,6 +112,9 @@ class Mustache_Test_Functional_Foo
         return sprintf('<em>%s</em>', $text);
     }
 
+    /**
+     * @param string $text
+     */
     public function wrapWithStrong($text)
     {
         return sprintf('<strong>%s</strong>', $text);

+ 2 - 1
test/Mustache/Test/Functional/MustacheSpecTest.php

@@ -132,7 +132,8 @@ class Mustache_Test_Functional_MustacheSpecTest extends PHPUnit_Framework_TestCa
      *
      * Loads YAML files from the spec and converts them to PHPisms.
      *
-     * @access public
+     * @param string $name
+     *
      * @return array
      */
     private function loadSpec($name)