Joli\Jane\OpenApi\Normalizer\Oauth2ImplicitSecurityNormalizer::normalize PHP Method

normalize() public method

public normalize ( $object, $format = null, array $context = [] )
$context array
    public function normalize($object, $format = null, array $context = [])
    {
        $data = new \stdClass();
        if (null !== $object->getType()) {
            $data->{'type'} = $object->getType();
        }
        if (null !== $object->getFlow()) {
            $data->{'flow'} = $object->getFlow();
        }
        if (null !== $object->getScopes()) {
            $values = new \stdClass();
            foreach ($object->getScopes() as $key => $value) {
                $values->{$key} = $value;
            }
            $data->{'scopes'} = $values;
        }
        if (null !== $object->getAuthorizationUrl()) {
            $data->{'authorizationUrl'} = $object->getAuthorizationUrl();
        }
        if (null !== $object->getDescription()) {
            $data->{'description'} = $object->getDescription();
        }
        return $data;
    }