mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -04:00
Remove CoreFunctions.php file, as PHPStan no longer complains about having all helper functions in Core.php
This commit is contained in:
parent
52e177b886
commit
d1ad02e3be
4 changed files with 32 additions and 36 deletions
|
@ -5,7 +5,7 @@
|
|||
},
|
||||
"autoload": {
|
||||
"psr-4": {"": "lib/"},
|
||||
"files": ["lib/Constants.php", "lib/CoreFunctions.php"]
|
||||
"files": ["lib/Constants.php"]
|
||||
},
|
||||
"platform":{
|
||||
"php": "8.1.2"
|
||||
|
|
10
composer.lock
generated
10
composer.lock
generated
|
@ -1138,16 +1138,16 @@
|
|||
"packages-dev": [
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.10.67",
|
||||
"version": "1.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493"
|
||||
"reference": "666cb1703742cea9cc80fee631f0940e1592fa6e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493",
|
||||
"reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/666cb1703742cea9cc80fee631f0940e1592fa6e",
|
||||
"reference": "666cb1703742cea9cc80fee631f0940e1592fa6e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1192,7 +1192,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-04-16T07:22:02+00:00"
|
||||
"time": "2024-05-13T06:02:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "thecodingmachine/phpstan-safe-rule",
|
||||
|
|
27
lib/Core.php
27
lib/Core.php
|
@ -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{
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
<?
|
||||
// Auto-included by Composer in composer.json
|
||||
// These functions are broken out of Core.php to satisfy PHPStan
|
||||
|
||||
use function Safe\ob_end_clean;
|
||||
use function Safe\ob_start;
|
||||
|
||||
// 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue