public static function createFromArray($key, array $data = [], ApiDefinition $apiDefinition = null)
    {
        $securityScheme = new static($key === 'null' ? null : $key);

        if (isset($data['description'])) {
            $securityScheme->setDescription($data['description']);
        }

        if (isset($data['type'])) {
            $securityScheme->setType($data['type']);
        }

        if (isset($data['describedBy'])) {
            $securityScheme->setDescribedBy(
                SecuritySchemeDescribedBy::createFromArray('describedBy', $data['describedBy'])
            );
        }

        if (isset($data['settings'])) {
            $securityScheme->setSettings($data['settings']);
        }

        return $securityScheme;
    }
public static function createFromArray($key, array $data = [], ApiDefinition $apiDefinition = null)
    {
        $securityScheme = new static($key === 'null' ? null : $key);

        if (isset($data['description'])) {
            $securityScheme->setDescription($data['description']);
        }

        if (isset($data['type'])) {
            $securityScheme->setType($data['type']);
        }

        if (isset($data['describedBy'])) {
            $securityScheme->setDescribedBy(
                SecuritySchemeDescribedBy::createFromArray('describedBy', $data['describedBy'])
            );
        }

        if (isset($data['settings'])) {
            $securityScheme->setSettings($data['settings']);
        }

        return $securityScheme;
    }
public static function createFromArray ( $ key , array $ data = [ ] , ApiDefinition $ apiDefinition = null ) { $ securityScheme = new static ( $ key === 'null' ? null : $ key ) ; if ( isset ( $ data [ 'description' ] ) ) { $ securityScheme -> setDescription ( $ data [ 'description' ] ) ; } if ( isset ( $ data [ 'type' ] ) ) { $ securityScheme -> setType ( $ data [ 'type' ] ) ; } if ( isset ( $ data [ 'describedBy' ] ) ) { $ securityScheme -> setDescribedBy ( SecuritySchemeDescribedBy :: createFromArray ( 'describedBy' , $ data [ 'describedBy' ] ) ) ; } if ( isset ( $ data [ 'settings' ] ) ) { $ securityScheme -> setSettings ( $ data [ 'settings' ] ) ; } return $ securityScheme ; }
Create a security scheme from an array

@param string $key
@param array $data
[
description: ?string
type:        ?string
describedBy: ?string[]
settings:    ?object[]
]
@param ApiDefinition $apiDefinition

@return SecurityScheme
Create a security scheme from an array