| @@ 166-179 (lines=14) @@ | ||
| 163 | return $this->whitelistGlobalFunctions; |
|
| 164 | } |
|
| 165 | ||
| 166 | public function isClassWhitelisted(string $name): bool |
|
| 167 | { |
|
| 168 | if (array_key_exists(strtolower($name), $this->classes)) { |
|
| 169 | return true; |
|
| 170 | } |
|
| 171 | ||
| 172 | foreach ($this->patterns as $pattern) { |
|
| 173 | if (1 === preg_match($pattern, $name)) { |
|
| 174 | return true; |
|
| 175 | } |
|
| 176 | } |
|
| 177 | ||
| 178 | return false; |
|
| 179 | } |
|
| 180 | ||
| 181 | public function isConstantWhitelisted(string $name): bool |
|
| 182 | { |
|
| @@ 181-194 (lines=14) @@ | ||
| 178 | return false; |
|
| 179 | } |
|
| 180 | ||
| 181 | public function isConstantWhitelisted(string $name): bool |
|
| 182 | { |
|
| 183 | if (array_key_exists(self::lowerConstantName($name), $this->constants)) { |
|
| 184 | return true; |
|
| 185 | } |
|
| 186 | ||
| 187 | foreach ($this->patterns as $pattern) { |
|
| 188 | if (1 === preg_match($pattern, $name)) { |
|
| 189 | return true; |
|
| 190 | } |
|
| 191 | } |
|
| 192 | ||
| 193 | return false; |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * @return string[] |
|