Remove CoreFunctions.php file, as PHPStan no longer complains about having all helper functions in Core.php

This commit is contained in:
Alex Cabal 2024-05-13 15:22:26 -05:00
parent 52e177b886
commit d1ad02e3be
4 changed files with 32 additions and 36 deletions

View file

@ -2,14 +2,39 @@
// Composer auto-loads the lib/ directory in composer.json
require __DIR__ . '/../vendor/autoload.php';
use function Safe\error_log;
use function Safe\mb_internal_encoding;
use function Safe\mb_http_output;
use function Safe\error_log;
use function Safe\ob_end_clean;
use function Safe\ob_start;
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
date_default_timezone_set('UTC');
// Convenience alias of var_dump.
function vd(mixed $var): void{
var_dump($var);
}
// var_dump($var) then die().
function vdd(mixed $var): void{
var_dump($var);
die();
}
// var_dump into a string.
function vds(mixed $var): string{
ob_start();
var_dump($var);
$str = ob_get_contents();
if($str === false){
$str = '';
}
ob_end_clean();
return $str;
}
// Custom error handler to output more details about the specific Apache request that caused an exception.
if(SITE_STATUS == SITE_STATUS_LIVE){
set_exception_handler(function(Throwable $ex): void{