@param \Fubhy\GraphQL\Language\Node $value

@return string|null
964305
public function coerceLiteral(Node $value)
    {
        if ($value instanceof EnumValue) {
            $key = $value->get('value');
            if (($lookup = $this->getNameLookup()) && isset($lookup[$key])) {
                return $lookup[$key] ? $lookup[$key]->getName() : NULL;
            }
        }

        return NULL;
    }
1222027
public static function decode($value)
    {
        if (empty($value)) {
            return null;
        }

        if (!is_string($value)) {
            throw new \InvalidArgumentException(sprintf(
                "Value type '%s' is not a PHP string so it cannot be unserialized.",
                gettype($value)
            ));
        }

        $data = unserialize($value);

        return $data;
    }
1021993
static public function getGenderValue($value=null)
    {
        return $value ? ($value == 1 || $value == '男' ? 1 : ($value == 2 || $value == '女' ? 2 : 0)) : 0;
    }
448616
private function normalizeValue($value)
    {
        if ($value instanceof NodeInterface) {
            $value = IDEncoder::encode($value);
        } elseif (\is_object($value)) {
            if (method_exists($value, '__toString')) {
                $value = (string) $value;
            } else {
                $value = null;
            }
        }

        return $value;
    }
510605
public function getTypeFromValue($value = null)
    {
        $value = ($value == null ? $this->value : $value);
        return array_search($this->value, self::$sourceList);
    }
569448
public function coerce($value)
    {
        $enumValue = $this->getValueLookup()[$value];
        return $enumValue ? $enumValue->getName() : NULL;
    }
1090320
public function value($value = NULL) {
        if($value == NULL) {
            return false;
        }
        
        $o = explode('.',$value);
        $data = $this->request->data;
        return $data[$o[0]][$o[1]][$o[2]];
    }
87414
public static function fromValue($value)
    {
        foreach (static::values() as $key => $enumInstance) {
            if ($enumInstance->getValue() === $value) {
                return $enumInstance;
            }
        }

        return null;
    }
70384
public static function convertToPhp($value)
    {
        if (is_string($value)) {
            return Translatable::createFromOriginalString($value);
        }

        if (is_array($value)) {
            return Translatable::createFromTranslations($value);
        }

        return null;
    }
318886
public function asParagraphs($value)
    {
        if ($value === null) {
            return $this->getNullDisplay();
        }

        return str_replace('<p></p>', '', '<p>' . preg_replace('/\R{2,}/u', "</p>\n<p>", Html::encode($value)) . '</p>');
    }
1267477
private function PrepareValue( $value )
	{
		if ( is_null( $value ) )
			return Undefined::getValue();

		if ( $value instanceof \DOMNode )
		{
			$nav = new DOM\DOMXPathNavigator( $value );
			return $nav;
		}

		if ( $value instanceof XPath2NodeIterator )
		{
			return $value;
		}

		if ( is_array( $value ) || $value instanceof \ArrayIterator )
		{
			return new NodeIterator( function() use( $value ) { return $this->CreateIterator( $value ); } );
		}

		return $value;
	}
717371
protected function _serializeOptionalValue($nodeName, $value)
	{
		return (!is_null($value) && $value !== '') ? $this->_serializeNode($nodeName, $value) : '';
	}
752236
public static function getHost($value)
    {
        if (preg_match(self::REGEXP_TCP, $value, $matches)) {
            return preg_replace("/^http:/", "tcp:", $matches[2]);
        }

        if (preg_match(self::REGEXP_SSL, $value, $matches)) {
            return preg_replace("/^https:/", "ssl:", $matches[2]);
        }

        return null;
    }
1113923
public function getSqlType($value)
    {
        if ('boolean' === gettype($value)) {
            return $this->connection->getDatabasePlatform()->convertBooleans($value);
        } elseif (null === $value || 'null' === $value) {
            return 'NULL';
        }

        return $this->connection->quote($value);
    }
605468
public function tokenize(string $value): string
    {
        $tokens = $this->tokenizer->tokenize($value);
        $tree = $this->buildTree($value, $tokens);

        $tokenizedValue = '';
        foreach ($tree as $node) {
            $tokenizedValue .= ($this->tokenizer->isOpeningToken($node))
                ? sprintf('<aliceTokenizedFunction(%s)>', $node)
                : $node
            ;
        }

        return $tokenizedValue;
    }
1130567
protected function csvEncode($value)
    {
        if (!$value) {
            return null;
        }
        return implode(
            ',',
            array_map(
                function ($x) {
                    return str_replace(',', '', $x);
                },
                array_values($value)
            )
        );
    }
630158
private function getScalarName($value)
    {
        if (is_bool($value)) {
            return $value ? 'true' : 'false';
        }
        if ($value === null) {
            return 'null';
        }

        if (is_string($value)) {
            return "'{$value}'";
        }
        if (is_int($value)) {
            return $value;
        }
        $name = sprintf('(%s) %s', gettype($value), (string) $value);

        return $name;
    }