Skip to content

Commit

Permalink
Remove deprecated ReflectionFunction->isDisabled() call
Browse files Browse the repository at this point in the history
  • Loading branch information
lisachenko committed Mar 26, 2024
1 parent a3e0e4b commit 67ed310
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions demos/Demo/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@

namespace Demo;

use ReflectionFunction;

/**
* Highlighter utility class
*/
final class Highlighter
{
/**
* Highlighter with built-in check for list of disabled function (Google AppEngine)
*
* @param string $file Name of the file
*/
public static function highlight(string $file): void
{
$highlightFileFunc = new ReflectionFunction('highlight_file');
if (!$highlightFileFunc->isDisabled()) {
if (function_exists('highlight_file')) {
highlight_file($file);
} else {
echo '<pre>' . htmlspecialchars(file_get_contents($file)) . '</pre>';
Expand Down

0 comments on commit 67ed310

Please sign in to comment.