@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * \remarks To run this script as CLI: phpunit filename.php |
26 | 26 | */ |
27 | 27 | |
28 | -global $conf,$user,$langs,$db; |
|
28 | +global $conf, $user, $langs, $db; |
|
29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
31 | 31 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -33,35 +33,35 @@ discard block |
||
33 | 33 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
34 | 34 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
35 | 35 | |
36 | -if (! defined('NOREQUIREUSER')) { |
|
36 | +if (!defined('NOREQUIREUSER')) { |
|
37 | 37 | define('NOREQUIREUSER', '1'); |
38 | 38 | } |
39 | -if (! defined('NOREQUIREDB')) { |
|
39 | +if (!defined('NOREQUIREDB')) { |
|
40 | 40 | define('NOREQUIREDB', '1'); |
41 | 41 | } |
42 | -if (! defined('NOREQUIRESOC')) { |
|
42 | +if (!defined('NOREQUIRESOC')) { |
|
43 | 43 | define('NOREQUIRESOC', '1'); |
44 | 44 | } |
45 | -if (! defined('NOREQUIRETRAN')) { |
|
45 | +if (!defined('NOREQUIRETRAN')) { |
|
46 | 46 | define('NOREQUIRETRAN', '1'); |
47 | 47 | } |
48 | -if (! defined('NOCSRFCHECK')) { |
|
48 | +if (!defined('NOCSRFCHECK')) { |
|
49 | 49 | define('NOCSRFCHECK', '1'); |
50 | 50 | } |
51 | -if (! defined('NOTOKENRENEWAL')) { |
|
51 | +if (!defined('NOTOKENRENEWAL')) { |
|
52 | 52 | define('NOTOKENRENEWAL', '1'); |
53 | 53 | } |
54 | -if (! defined('NOREQUIREMENU')) { |
|
54 | +if (!defined('NOREQUIREMENU')) { |
|
55 | 55 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
56 | 56 | } |
57 | -if (! defined('NOREQUIREHTML')) { |
|
57 | +if (!defined('NOREQUIREHTML')) { |
|
58 | 58 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
59 | 59 | } |
60 | -if (! defined('NOREQUIREAJAX')) { |
|
60 | +if (!defined('NOREQUIREAJAX')) { |
|
61 | 61 | define('NOREQUIREAJAX', '1'); |
62 | 62 | } |
63 | -if (! defined("NOLOGIN")) { |
|
64 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
63 | +if (!defined("NOLOGIN")) { |
|
64 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if (empty($user->id)) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | )); |
114 | 114 | */ |
115 | - return array_map(function ($value) { |
|
115 | + return array_map(function($value) { |
|
116 | 116 | return array($value); |
117 | 117 | }, $filesarray); |
118 | 118 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | || preg_match('/modules\/(import|mailings|printing)\//', $file['relativename']) |
146 | 146 | || in_array($file['name'], array('modules_boxes.php', 'TraceableDB.php'))) { |
147 | 147 | // Check Class files |
148 | - if (! in_array($file['name'], array( |
|
148 | + if (!in_array($file['name'], array( |
|
149 | 149 | 'api.class.php', |
150 | 150 | 'commonobject.class.php', |
151 | 151 | 'conf.class.php', |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | //exit; |
170 | 170 | } |
171 | 171 | |
172 | - if (preg_match('/\.class\.php$/', $file['relativename']) && ! in_array($file['relativename'], array( |
|
172 | + if (preg_match('/\.class\.php$/', $file['relativename']) && !in_array($file['relativename'], array( |
|
173 | 173 | 'adherents/class/adherent.class.php', |
174 | 174 | 'adherents/canvas/actions_adherentcard_common.class.php', |
175 | 175 | 'contact/canvas/actions_contactcard_common.class.php', |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | } else { |
215 | 215 | // Check Include files |
216 | - if (! in_array($file['name'], array( |
|
216 | + if (!in_array($file['name'], array( |
|
217 | 217 | 'objectline_view.tpl.php', |
218 | 218 | 'extrafieldsinexport.inc.php', |
219 | 219 | 'extrafieldsinimport.inc.php', |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | $found = ""; |
375 | 375 | preg_match_all('/(sql|SET|WHERE|where|INSERT|insert|VALUES|LIKE).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER); |
376 | 376 | foreach ($matches as $key => $val) { |
377 | - if (! in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) { |
|
377 | + if (!in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'dbs->id', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) { |
|
378 | 378 | $found = $val[0]; |
379 | - $ok = false; // This will generate error |
|
379 | + $ok = false; // This will generate error |
|
380 | 380 | break; |
381 | 381 | } |
382 | 382 | //if ($reg[0] != 'db') $ok=false; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $found = ""; |
392 | 392 | preg_match_all('/(\$sql|SET\s|WHERE\s|INSERT\s|VALUES\s|VALUES\().+\s*\'\s*\.\s*\$(.........)/', $filecontent, $matches, PREG_SET_ORDER); |
393 | 393 | foreach ($matches as $key => $val) { |
394 | - if (! in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) { |
|
394 | + if (!in_array($val[2], array('this->db-', 'db->prefi', 'db->sanit', 'dbs->pref', 'dbs->sani', 'conf->ent', 'key : \'\')', 'key])."\')', 'excludefi', 'regexstri', ''))) { |
|
395 | 395 | $found = $val[0]; |
396 | 396 | $ok = false; |
397 | 397 | var_dump($matches); |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | { |
771 | 771 | return preg_replace_callback( |
772 | 772 | '{(//.*?$)|(/\*.*?\*/)}ms', |
773 | - static function ($match) { |
|
773 | + static function($match) { |
|
774 | 774 | if (isset($match[2])) { |
775 | 775 | // Count the number of newline characters in the comment |
776 | 776 | $num_newlines = substr_count($match[0], "\n"); |