Switch to new array shorthand

This commit is contained in:
Alex Cabal 2021-10-06 18:03:28 -05:00
parent acdc7eb639
commit 7be2f18424
4 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ date_default_timezone_set('UTC');
// Custom error handler to output more details about the specific Apache request that caused an exception.
set_exception_handler(function(Throwable $ex): void{
$errorString = "----------------------------------------\n";
$errorString .= trim(vds(array_intersect_key($_SERVER, array('REQUEST_URI' => '', 'QUERY_STRING' => '', 'REQUEST_METHOD' => '', 'REDIRECT_QUERY_STRING' => '', 'REDIRECT_URL' => '', 'SCRIPT_FILENAME' => '', 'REMOTE_ADDR' => '', 'HTTP_COOKIE' => '', 'HTTP_USER_AGENT' => '', 'SCRIPT_URI' => ''))));
$errorString .= trim(vds(array_intersect_key($_SERVER, ['REQUEST_URI' => '', 'QUERY_STRING' => '', 'REQUEST_METHOD' => '', 'REDIRECT_QUERY_STRING' => '', 'REDIRECT_URL' => '', 'SCRIPT_FILENAME' => '', 'REMOTE_ADDR' => '', 'HTTP_COOKIE' => '', 'HTTP_USER_AGENT' => '', 'SCRIPT_URI' => ''])));
if(sizeof($_POST) > 0){
$errorString .= "POST DATA:\n";

View file

@ -34,7 +34,7 @@ class HttpInput{
}
private static function GetHttpVar(string $variable, int $type, int $set, $default){
$vars = array();
$vars = [];
switch($set){
case GET:

View file

@ -6,7 +6,7 @@ use function Safe\getopt;
use function Safe\preg_replace;
use function Safe\sort;
$longopts = array("webroot:", "weburl:");
$longopts = ["webroot:", "weburl:"];
$options = getopt("", $longopts);
$webRoot = $options["webroot"] ?? "/standardebooks.org/web";
$webUrl = $options["weburl"] ?? "https://standardebooks.org";

View file

@ -7,7 +7,7 @@ use function Safe\krsort;
use function Safe\preg_replace;
use function Safe\strtotime;
$longopts = array("webroot:", "weburl:");
$longopts = ["webroot:", "weburl:"];
$options = getopt("", $longopts);
$webRoot = $options["webroot"] ?? "/standardebooks.org/web";
$webUrl = $options["weburl"] ?? "https://standardebooks.org";