private static function getGraphqlScalar(string $className, GQL\Scalar $scalarAnnotation, array $classAnnotations)
    {
        $scalarConfiguration = [];

        if ($scalarAnnotation->scalarType) {
            $scalarConfiguration['scalarType'] = self::formatExpression($scalarAnnotation->scalarType);
        } else {
            $scalarConfiguration = [
                'serialize' => [$className, 'serialize'],
                'parseValue' => [$className, 'parseValue'],
                'parseLiteral' => [$className, 'parseLiteral'],
            ];
        }

        $scalarConfiguration = self::getDescriptionConfiguration($classAnnotations) + $scalarConfiguration;

        return ['type' => 'custom-scalar', 'config' => $scalarConfiguration];
    }
private static function getGraphqlScalar(string $className, GQL\Scalar $scalarAnnotation, array $classAnnotations)
    {
        $scalarConfiguration = [];

        if ($scalarAnnotation->scalarType) {
            $scalarConfiguration['scalarType'] = self::formatExpression($scalarAnnotation->scalarType);
        } else {
            $scalarConfiguration = [
                'serialize' => [$className, 'serialize'],
                'parseValue' => [$className, 'parseValue'],
                'parseLiteral' => [$className, 'parseLiteral'],
            ];
        }

        $scalarConfiguration = self::getDescriptionConfiguration($classAnnotations) + $scalarConfiguration;

        return ['type' => 'custom-scalar', 'config' => $scalarConfiguration];
    }
private static function getGraphqlScalar ( string $ className , GQL \ Scalar $ scalarAnnotation , array $ classAnnotations ) { $ scalarConfiguration = [ ] ; if ( $ scalarAnnotation -> scalarType ) { $ scalarConfiguration [ 'scalarType' ] = self :: formatExpression ( $ scalarAnnotation -> scalarType ) ; } else { $ scalarConfiguration = [ 'serialize' => [ $ className , 'serialize' ] , 'parseValue' => [ $ className , 'parseValue' ] , 'parseLiteral' => [ $ className , 'parseLiteral' ] , ] ; } $ scalarConfiguration = self :: getDescriptionConfiguration ( $ classAnnotations ) + $ scalarConfiguration ; return [ 'type' => 'custom-scalar' , 'config' => $ scalarConfiguration ] ; }
Get a Graphql scalar configuration from given scalar annotation.

@param string     $shortClassName
@param string     $className
@param GQL\Scalar $scalarAnnotation
@param array      $classAnnotations

@return array
Get a Graphql scalar configuration from given scalar annotation .