@@ -16,9 +16,18 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | interface Twig_Sandbox_SecurityPolicyInterface |
| 18 | 18 | { |
| 19 | + /** |
|
| 20 | + * @return void |
|
| 21 | + */ |
|
| 19 | 22 | public function checkSecurity($tags, $filters, $functions); |
| 20 | 23 | |
| 24 | + /** |
|
| 25 | + * @return boolean|null |
|
| 26 | + */ |
|
| 21 | 27 | public function checkMethodAllowed($obj, $method); |
| 22 | 28 | |
| 29 | + /** |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 23 | 32 | public function checkPropertyAllowed($obj, $method); |
| 24 | 33 | } |
@@ -18,6 +18,10 @@ discard block |
||
| 18 | 18 | abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase |
| 19 | 19 | { |
| 20 | 20 | abstract protected function getExtensions(); |
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @return string |
|
| 24 | + */ |
|
| 21 | 25 | abstract protected function getFixturesDir(); |
| 22 | 26 | |
| 23 | 27 | /** |
@@ -141,6 +145,9 @@ discard block |
||
| 141 | 145 | } |
| 142 | 146 | } |
| 143 | 147 | |
| 148 | + /** |
|
| 149 | + * @param string $test |
|
| 150 | + */ |
|
| 144 | 151 | protected static function parseTemplates($test) |
| 145 | 152 | { |
| 146 | 153 | $templates = array(); |
@@ -17,5 +17,8 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | interface Twig_TestCallableInterface |
| 19 | 19 | { |
| 20 | + /** |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 20 | 23 | public function getCallable(); |
| 21 | 24 | } |
@@ -20,6 +20,7 @@ |
||
| 20 | 20 | * Sets the parser associated with this token parser |
| 21 | 21 | * |
| 22 | 22 | * @param $parser A Twig_Parser instance |
| 23 | + * @return void |
|
| 23 | 24 | */ |
| 24 | 25 | public function setParser(Twig_Parser $parser); |
| 25 | 26 | |
@@ -175,6 +175,9 @@ |
||
| 175 | 175 | $this->assertEquals('<p>username</p>', $twig->loadTemplate('index')->render(array())); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | + /** |
|
| 179 | + * @param boolean $sandboxed |
|
| 180 | + */ |
|
| 178 | 181 | protected function getEnvironment($sandboxed, $options, $templates, $tags = array(), $filters = array(), $methods = array(), $properties = array(), $functions = array()) |
| 179 | 182 | { |
| 180 | 183 | $loader = new Twig_Loader_Array($templates); |
@@ -59,6 +59,9 @@ |
||
| 59 | 59 | $this->assertFalse(file_exists($cacheFileName), 'Cache file was not cleared.'); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $target |
|
| 64 | + */ |
|
| 62 | 65 | private function removeDir($target) |
| 63 | 66 | { |
| 64 | 67 | $fp = opendir($target); |
@@ -40,6 +40,10 @@ |
||
| 40 | 40 | $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '}')); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $template |
|
| 45 | + * @param string $value |
|
| 46 | + */ |
|
| 43 | 47 | protected function countToken($template, $type, $value = null) |
| 44 | 48 | { |
| 45 | 49 | $lexer = new Twig_Lexer(new Twig_Environment()); |
@@ -71,6 +71,9 @@ |
||
| 71 | 71 | return $tests; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $name |
|
| 76 | + */ |
|
| 74 | 77 | protected function createFunction($name, array $arguments = array()) |
| 75 | 78 | { |
| 76 | 79 | return new Twig_Node_Expression_Function($name, new Twig_Node($arguments), 1); |
@@ -40,6 +40,10 @@ |
||
| 40 | 40 | return $tests; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param Twig_Node_Expression_Constant $node |
|
| 45 | + * @param string $name |
|
| 46 | + */ |
|
| 43 | 47 | protected function createTest($node, $name, array $arguments = array()) |
| 44 | 48 | { |
| 45 | 49 | return new Twig_Node_Expression_Test($node, $name, new Twig_Node($arguments), 1); |