芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/vendor/plesk/api-php-lib/src/Api/AbstractStruct.php
{key($property)}; } else { /** @psalm-suppress PossiblyInvalidArgument */ $classPropertyName = $this->underToCamel(str_replace('-', '_', $property)); $value = $apiResponse->$property; } $reflectionProperty = new \ReflectionProperty($this, $classPropertyName); $propertyType = $reflectionProperty->getType(); if (is_null($propertyType)) { $docBlock = $reflectionProperty->getDocComment(); $propertyType = preg_replace('/^.+ @var ([a-z]+) .+$/', '\1', $docBlock); } else { /** @psalm-suppress UndefinedMethod */ $propertyType = $propertyType->getName(); } if ('string' == $propertyType) { $value = (string) $value; } elseif ('int' == $propertyType) { $value = (int) $value; } elseif ('bool' == $propertyType) { $value = in_array((string) $value, ['true', 'on', 'enabled']); } else { throw new \Exception("Unknown property type '$propertyType'."); } $this->$classPropertyName = $value; } } /** * Convert underscore separated words into camel case. * * @param string $under * * @return string */ private function underToCamel(string $under): string { $under = '_' . str_replace('_', ' ', strtolower($under)); return ltrim(str_replace(' ', '', ucwords($under)), '_'); } }