mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 05:29:53 +09:00
Update to laravel 7
This commit is contained in:
@@ -17,15 +17,20 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
* Casts common resource types to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ResourceCaster
|
||||
{
|
||||
public static function castCurl($h, array $a, Stub $stub, $isNested)
|
||||
/**
|
||||
* @param \CurlHandle|resource $h
|
||||
*/
|
||||
public static function castCurl($h, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
return curl_getinfo($h);
|
||||
}
|
||||
|
||||
public static function castDba($dba, array $a, Stub $stub, $isNested)
|
||||
public static function castDba($dba, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$list = dba_list();
|
||||
$a['file'] = $list[(int) $dba];
|
||||
@@ -33,27 +38,27 @@ class ResourceCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castProcess($process, array $a, Stub $stub, $isNested)
|
||||
public static function castProcess($process, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return proc_get_status($process);
|
||||
}
|
||||
|
||||
public static function castStream($stream, array $a, Stub $stub, $isNested)
|
||||
public static function castStream($stream, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
|
||||
if (isset($a['uri'])) {
|
||||
if ($a['uri'] ?? false) {
|
||||
$a['uri'] = new LinkStub($a['uri']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castStreamContext($stream, array $a, Stub $stub, $isNested)
|
||||
public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return @stream_context_get_params($stream) ?: $a;
|
||||
}
|
||||
|
||||
public static function castGd($gd, array $a, Stub $stub, $isNested)
|
||||
public static function castGd($gd, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['size'] = imagesx($gd).'x'.imagesy($gd);
|
||||
$a['trueColor'] = imageistruecolor($gd);
|
||||
@@ -61,7 +66,7 @@ class ResourceCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castMysqlLink($h, array $a, Stub $stub, $isNested)
|
||||
public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['host'] = mysql_get_host_info($h);
|
||||
$a['protocol'] = mysql_get_proto_info($h);
|
||||
@@ -70,7 +75,7 @@ class ResourceCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castOpensslX509($h, array $a, Stub $stub, $isNested)
|
||||
public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$stub->cut = -1;
|
||||
$info = openssl_x509_parse($h, false);
|
||||
|
||||
Reference in New Issue
Block a user