projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #20096 from larssandergreen/copy-template_type-when-cloning-mailing
[civicrm-core.git]
/
tools
/
scripts
/
tpl-lint
diff --git
a/tools/scripts/tpl-lint
b/tools/scripts/tpl-lint
index d2e8bcb19d796f738b124fcbcaa4681f8174588d..04b6f856754ea73f15e0786d7085aba632e092a3 100755
(executable)
--- a/
tools/scripts/tpl-lint
+++ b/
tools/scripts/tpl-lint
@@
-3,7
+3,7
@@
// FIXME: Make this a proper app with unit-tests
// 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));
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) {
$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);
});
}
printf("[%s] %s\n", $file, $message);
});
}
@@
-74,6
+74,8
@@
function check_a($a, $reporter) {
/**
* Determine if snippet of JS returns strictly false
/**
* Determine if snippet of JS returns strictly false
+ * @param $js
+ * @return bool
*/
function js_returns_false($js) {
return
*/
function js_returns_false($js) {
return
@@
-86,6
+88,8
@@
function js_returns_false($js) {
/**
* Determine if snippet of JS returns a function call
/**
* 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);
*/
function js_returns_func($js) {
return preg_match('/^ *return +[a-zA-Z0-9\._$]+\(/', $js);