Merge pull request #16874 from colemanw/contactCleanup
[civicrm-core.git] / tools / scripts / tpl-lint
index d2e8bcb19d796f738b124fcbcaa4681f8174588d..04b6f856754ea73f15e0786d7085aba632e092a3 100755 (executable)
@@ -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);