public function _get_defined_constants(array $constants = [])
{
if (count($this->whitelist['constants'])) {
$constants = [];
foreach ($this->whitelist['constants'] as $name => $value) {
if (defined($name)) {
$constants[$name] = $name;
}
}
foreach ($this->definitions['constants'] as $name => $value) {
if (defined($name)) {
//these shouldn't be undefined, but just in case they are we don't want to report inaccurate information
$constants[$name] = $name;
}
}
return array_values($constants);
} else {
if (count($this->blacklist['constants'])) {
foreach ($constants as $index => $name) {
if (isset($this->blacklist['constants'][$name])) {
unset($constants[$index]);
}
}
reset($constants);
return $constants;
}
}
return [];
}