X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tools%2Fscripts%2Ftpl-lint;h=04b6f856754ea73f15e0786d7085aba632e092a3;hb=9d7f1db5a531f4768d7804a46b96d896a9965e22;hp=d2e8bcb19d796f738b124fcbcaa4681f8174588d;hpb=727983225106f0901a3f8639a068a1aa71fb18e4;p=civicrm-core.git diff --git a/tools/scripts/tpl-lint b/tools/scripts/tpl-lint index d2e8bcb19d..04b6f85675 100755 --- a/tools/scripts/tpl-lint +++ b/tools/scripts/tpl-lint @@ -3,7 +3,7 @@ // FIXME: Make this a proper app with unit-tests -$civi_pkgs_dir = dirname( dirname( dirname( __FILE__ ) ) ) . DIRECTORY_SEPARATOR . 'packages'; +$civi_pkgs_dir = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'packages'; require_once $civi_pkgs_dir . DIRECTORY_SEPARATOR . 'simple_html_dom.php'; exit(main($argv)); @@ -19,7 +19,7 @@ function main($argv) { $files = $argv; array_shift($files); // skip program name foreach ($files as $file) { - check_tpl($file, function($code, $message) use ($file) { + check_tpl($file, function ($code, $message) use ($file) { printf("[%s] %s\n", $file, $message); }); } @@ -74,6 +74,8 @@ function check_a($a, $reporter) { /** * Determine if snippet of JS returns strictly false + * @param $js + * @return bool */ function js_returns_false($js) { return @@ -86,6 +88,8 @@ function js_returns_false($js) { /** * Determine if snippet of JS returns a function call + * @param $js + * @return int */ function js_returns_func($js) { return preg_match('/^ *return +[a-zA-Z0-9\._$]+\(/', $js);