Permalink
Browse files

- Added missing `static` declaration to avoid E_STRIC messages

  • Loading branch information...
1 parent cfe4801 commit 8e9afcba8806a1bef16cdfae50a5353d00f5037e @crodas committed Aug 9, 2010
View
@@ -4,7 +4,7 @@
{
public $is_block = TRUE;
- function main($html)
+ static function main($html)
{
return strtolower($html);
}
@@ -4,7 +4,7 @@ class Haanga_Extension_Tag_MeneamePagination
{
public $is_block = FALSE;
- function generator($cmp, $args, $redirected)
+ static function generator($cmp, $args, $redirected)
{
if (count($args) != 3 && count($args) != 4) {
throw new Haanga_CompilerException("Memeame_Pagination requires 3 or 4 parameters");
View
@@ -98,12 +98,12 @@ public static function is_expr($arr)
}
- function str($string)
+ public static function str($string)
{
return array("string" => $string);
}
- function num($number)
+ public static function num($number)
{
return array("number" => $number);
}
@@ -122,7 +122,7 @@ function append_ast(Haanga_AST $obj)
return $this;
}
- function constant($str)
+ static function constant($str)
{
return array('constant' => $str);
}
@@ -57,7 +57,7 @@ class Haanga_Compiler_Lexer
$this->line = 1;
}
- function init($template, $compiler)
+ static function init($template, $compiler)
{
$lexer = new Haanga_Compiler_Lexer($template, $compiler);
$parser = new Haanga_Compiler_Parser($lexer);
@@ -57,7 +57,7 @@ function __construct($data, $compiler)
$this->line = 1;
}
- function init($template, $compiler)
+ static function init($template, $compiler)
{
$lexer = new Haanga_Compiler_Lexer($template, $compiler);
$parser = new Haanga_Compiler_Parser($lexer);
@@ -16,7 +16,7 @@
* or less django style).
*
*/
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
return hexec('str_replace', $args[1], "", $args[0]);
}
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Date
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
return hexec('date', $args[1], $args[0]);
}
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Default
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
return hexpr_cond(hexpr(hexec('empty', $args[0]), '==', TRUE), $args[1], $args[0]);
}
@@ -8,7 +8,7 @@ class Haanga_Extension_Filter_Dictsort
* filter is included at rendering time, if you want
* to see the generated version see tags/dictsort.php
*/
- function main($array, $sort_by)
+ static function main($array, $sort_by)
{
$field = array();
foreach ($array as $key => $item) {
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Join
{
- public function generator($compiler, $args)
+ public static function generator($compiler, $args)
{
if (count($args) == 1) {
$args[1] = "";
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Length
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
if (Haanga_AST::is_str($args[0])) {
return hexec('strlen', $args[0]);
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Pluralize
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
if (count($args) > 1) {
if (!Haanga_AST::is_str($args[1])) {
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Reverse
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
if (count($args) != 1) {
throw new Haanga_Compiler_Exception("Reverse only needs one parameter");
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Safe
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
$compiler->var_is_safe = TRUE;
return current($args);
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Title
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
if (count($args) != 1) {
throw new Haanga_Compiler_Exception("title filter only needs one parameter");
@@ -2,7 +2,7 @@
class Haanga_Extension_Filter_Truncatewords
{
- function main($text, $limit)
+ static function main($text, $limit)
{
$words = explode(" ", $text, $limit+1);
if (count($words) == $limit+1) {
@@ -3,7 +3,7 @@
class Haanga_Extension_Filter_UrlEncode
{
- public function generator($cmp, $args)
+ public static function generator($cmp, $args)
{
$cmp->var_is_safe = TRUE;
return hexec('urlencode', $args[0]);
@@ -4,7 +4,7 @@ class Haanga_Extension_Tag_Cycle
{
public $is_block = FALSE;
- function generator($cmp, $args, $declared)
+ static function generator($cmp, $args, $declared)
{
static $cycle = 0;
if (!isset($cmp->cycle)) {
@@ -8,7 +8,7 @@ class Haanga_Extension_Tag_Dictsort
* property on each sub-array. , if you want
* to see the original php file look filters/dictsort.php
*/
- function generator($cmp, $args, $redirected)
+ static function generator($cmp, $args, $redirected)
{
if (!$redirected) {
throw new Haanga_Compiler_Exception("dictsort must be redirected to a variable using AS <varname>");
@@ -5,7 +5,7 @@ class Haanga_Extension_Tag_Exec
{
public $is_block = FALSE;
- function generator($cmp, $args, $assign=NULL)
+ static function generator($cmp, $args, $assign=NULL)
{
if (!$cmp->getOption('allow_exec')) {
throw new Haanga_Compiler_Exception("Tag exec is disabled for security reasons");
@@ -6,7 +6,7 @@ class Haanga_Extension_Tag_FirstOf
* firstof tag
*
*/
- function generator($cmp, $args)
+ static function generator($cmp, $args)
{
$count = count($args);
$args = array_reverse($args);
@@ -4,7 +4,7 @@ class Haanga_Extension_Tag_SetSafe
{
public $is_block = FALSE;
- function generator($cmp, $args)
+ static function generator($cmp, $args)
{
foreach ($args as $arg) {
if (Haanga_AST::is_var($arg)) {
@@ -13,16 +13,16 @@ class Haanga_Extension_Tag_Spaceless
/**
* main() {{{
*
- * This function contains the definition of spaceless
+ * This static function contains the definition of spaceless
* tag, it is important not to refence to $compiler since it
* will copied and paste in the generated PHP code from the
- * template as a function.
+ * template as a static function.
*
* It is also important to put the start and the end of the
- * function in new lines.
+ * static function in new lines.
*
*
- static function main($html)
+ static static function main($html)
{
$regex = array(
'/>[ \t\r\n]+</sU',
@@ -39,7 +39,7 @@ static function main($html)
* calling Spaceless_Tag::main() at everytime.
*
*/
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
$regex = array('/>[ \t\r\n]+</sU','/^[ \t\r\n]+</sU','/>[ \t\r\n]+$/sU');
$repl = array('><', '<', '>');
@@ -2,7 +2,7 @@
class Haanga_Extension_Tag_Templatetag
{
- function generator($compiler, $args)
+ static function generator($compiler, $args)
{
if (count($args) != 1) {
throw new Haanga_Compiler_Exception("templatetag only needs one parameter");
@@ -4,7 +4,7 @@ class Haanga_Extension_Tag_Trans
{
public $is_block = FALSE;
- function generator($cmp, $args, $rebuild)
+ static function generator($cmp, $args, $rebuild)
{
$code = hcode();
@@ -1,5 +1,6 @@
<?php
+$obj = new Stdclass;
$obj->name = 'foo';
$obj->obj['name'] = 'bar';
$arr['obj'] = $obj;

0 comments on commit 8e9afcb

Please sign in to comment.