ApiPlatform\Core\Metadata\Extractor\YamlExtractor::phpize PHP Метод

phpize() приватный метод

Transforms a YAML attribute's value in PHP value.
private phpize ( array $array, string $key, string $type ) : boolean | string | null
$array array
$key string
$type string
Результат boolean | string | null
    private function phpize(array $array, string $key, string $type)
    {
        if (!isset($array[$key])) {
            return;
        }
        switch ($type) {
            case 'bool':
                if (is_bool($array[$key])) {
                    return $array[$key];
                }
                break;
            case 'string':
                if (is_string($array[$key])) {
                    return $array[$key];
                }
                break;
        }
        throw new InvalidArgumentException(sprintf('The property "%s" must be a "%s", "%s" given.', $key, $type, gettype($array[$key])));
    }