public function __construct() { parent::__construct("lint-const-literals", "Lint (use of lower- or mixed-case string literals)"); foreach (get_defined_constants() as $const_name => $value) { $this->system_constants[$const_name] = true; } }
public function __construct() { parent::__construct("lint-assignment-in-condition", "Lint (assignment in condition)"); }
public function __construct() { parent::__construct("lint-static-this", "Lint (use of \$this outside of instance methods)"); }
public function __construct() { parent::__construct("lint-closing-tag", "Lint (use of php closing tag)"); }
public function __construct() { parent::__construct("lint-uninitialized-vars", "Lint (use of uninitialized vars)"); // super global variables $superGlobals = array('$GLOBALS', '$_REQUEST', '$_GET', '$_POST', '$_FILES', '$_ENV', '$_SERVER', '$_COOKIE', '$_SESSION', '$HTTP_RAW_POST_DATA', '$http_response_header', '$php_errormsg', '$this'); self::$knownSuperglobals = array_fill_keys($superGlobals, true); // global variables self::$knownGlobals = array_merge(array('$argv', '$argc'), XRef::getConfigValue("lint.add-global-var", array())); // some functions take pass-by-reference params but they don't initialize them, // the params must already exist, e.g. bool sort ( array &$array [, int $sort_flags] ) $exceptions = array('array_multisort', 'array_pop', 'array_push', 'array_shift', 'array_splice', 'array_unshift', 'array_walk', 'array_walk_recursive', 'arsort', 'asort', 'call_user_method', 'call_user_method_array', 'current', 'each', 'end', 'extract', 'key', 'krsort', 'ksort', 'mb_convert_variables', 'natcasesort', 'natsort', 'next', 'openssl_csr_new', 'pos', 'prev', 'reset', 'rsort', 'settype', 'shuffle', 'sort', 'uasort', 'uksort', 'usort', 'xml_set_object'); self::$internalFunctionsThatDoesntInitializePassedByReferenceParams = array_fill_keys($exceptions, true); $this->projectDatabase = new XRef_ProjectDatabase(); $this->projectDatabase->finalize(); }