Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -15,13 +15,15 @@ use Symfony\Component\VarDumper\Cloner\Stub;
/**
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
*
* @final
*/
class MemcachedCaster
{
private static $optionConstants;
private static $defaultOptions;
public static function castMemcached(\Memcached $c, array $a, Stub $stub, $isNested)
public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested)
{
$a += [
Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(),
@@ -33,7 +35,7 @@ class MemcachedCaster
return $a;
}
private static function getNonDefaultOptions(\Memcached $c)
private static function getNonDefaultOptions(\Memcached $c): array
{
self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
@@ -48,7 +50,7 @@ class MemcachedCaster
return $nonDefaultOptions;
}
private static function discoverDefaultOptions()
private static function discoverDefaultOptions(): array
{
$defaultMemcached = new \Memcached();
$defaultMemcached->addServer('127.0.0.1', 11211);
@@ -63,13 +65,13 @@ class MemcachedCaster
return $defaultOptions;
}
private static function getOptionConstants()
private static function getOptionConstants(): array
{
$reflectedMemcached = new \ReflectionClass(\Memcached::class);
$optionConstants = [];
foreach ($reflectedMemcached->getConstants() as $constantKey => $value) {
if (0 === strpos($constantKey, 'OPT_')) {
if (str_starts_with($constantKey, 'OPT_')) {
$optionConstants[$constantKey] = $value;
}
}