Get the descriptive name for the given value.

@param int|string $value The value to get the name of a constant for.
@return bool|string
429447
public static function getNameForValue($value)
    {
        foreach (self::getConstants() as $constant) {
            if ($constant['value'] === $value) {
                return $constant['name'];
            }
        }
        return false;
    }
232747
public static function getStringValue($value): string
    {
        if ($value instanceof \DateTime) {
            return $value->format(self::DEFAULT_DATETIME_FORMAT);
        } elseif (is_bool($value)) {
            return $value ? 'true' : 'false';
        } elseif (is_array($value)) {
            return implode(', ', array_map('self::getStringValue', $value));
        }

        return (string) $value;
    }
1004874
public function getNamePrefix($value)
    {
        if (empty($value)) {
            return null;
        }
        preg_match('/(?:\@(?P<prefix>INLINE))?(?P<value>.+)/is', $value, $matches);

        return [
            'prefix' => Helper::getValue($matches['prefix']),
            'value' => Helper::getValue($matches['value'])
        ];
    }
920505
protected function _value($value)
    {
        if ($value === null) {
            return 'null';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }

        return (string)$value;
    }
227251
protected static function getLocalizedDescription($value): ?string
    {
        if (static::isLocalizable())
        {
            $localizedStringKey = static::getLocalizationKey() . '.' . $value;

            if (Lang::has($localizedStringKey))
            {
                return __($localizedStringKey);
            }
        }

        return null;
    }
930575
public static function getTypeFromValue($value)
    {
        switch (gettype($value)) {
            case 'boolean':
                if ($value) {
                    return Type::getTrue();
                }

                return Type::getFalse();

            case 'integer':
                return Type::getInt(false, $value);

            case 'double':
                return Type::getFloat($value);

            case 'string':
                return Type::getString($value);

            case 'array':
                return Type::getArray();

            case 'NULL':
                return Type::getNull();

            default:
                return Type::getMixed();
        }
    }
1204872
protected function id2alias($value)
    {
        $announcement = $this->announcementRepository->findByID($value);

        $alias = $announcement->getTitle() . self::SEPARATOR_OFFSET . dechex(intval($announcement->getID()));

        return $this->cleanUrl($alias);
    }
879368
public static function getValueName($value, $strict = false)
    {
        if (!static::isValidValue($value)) {
            throw new \InvalidArgumentException('No enum name was found for the value supplied.');
        }

        return array_search($value, static::$constants, $strict);
    }
1291139
protected function getValue($value)
    {
        if (is_numeric($value)) {
            return false !== strpos('.', $value) ? (double)$value : (int)$value;
        }
        return $value;
    }
825171
public static function describe($value): string
    {
        if (is_array($value)) {
            $value = '<array>';
        } elseif (is_object($value) || is_callable($value) || is_iterable($value)) {
            $value = sprintf('<%s>', get_class($value));
        } else {
            $value = (string)$value;
            if (strlen($value) > 30) {
                $value = substr($value, 0, -3) . '...';
            }
            $value = sprintf('"%s"', $value);
        }
        return $value;
    }
428391
private function getTypedValue(string $value)
    {
        if (\in_array($value, self::$boolValues, true)) {
            return \in_array($value, self::$truthlyValues, true);
        }

        if (\is_numeric($value)) {
            return $this->getNumericValue($value);
        }

        return $value;
    }
142378
public function resourceName($value = null)
    {
        if ($value !== null) {
            return $this->setConfig('name', $value);
        }

        if (empty($this->_config['name'])) {
            $this->setConfig('name', $this->_deriveResourceName());
        }

        return $this->getConfig('name');
    }
1209546
public static function getStringForTable($value)
    {
        if (true === is_string($value)) {
            return wordwrap($value, self::MAX_STRING_LENGTH, PHP_EOL);
        }

        if (true === is_bool($value)) {
            if (true === $value) {
                return 'TRUE';
            }

            return 'FALSE';
        }

        if ($value instanceof \DateTime) {
            return $value->format('Y-m-d H:i:s');
        }

        if (null === $value) {
            return 'NULL';
        }

        if (true === is_array($value)) {
            $result = [];
            foreach ($value as $arrayIndex => $arrayValue) {
                if (true === is_numeric($arrayIndex)) {
                    $result[] = self::getStringForTable($arrayValue);

                    continue;
                }

                $result[] = sprintf('%s : %s', $arrayIndex, self::getStringForTable($arrayValue));
            }

            return implode(PHP_EOL, $result);
        }

        return json_encode($value);
    }
942828
private function getValue($value)
    {
        if (!is_string($value)) {
            return $value;
        }

        if ($value[0] != '%' || $value[strlen($value) - 1] != '%')  {
            return $value;
        }

        $parameter = trim($value, '%');
        if ($this->container->hasParameter($parameter)) {
            return $this->container->getParameter($parameter);
        }

        return $value;
    }
921309
private static function getTypeStyle($value)
    {
        if (\is_int($value) || \is_float($value)) {
            return 'number';
        } elseif (\is_string($value)) {
            return 'string';
        } elseif (\is_bool($value) || \is_null($value)) {
            return 'bool';
        } else {
            return 'strong'; // @codeCoverageIgnore
        }
    }
1368879
protected function getContinuedValues($value)
    {
        while ($this->isContinuedValue($this->nextLine(false))) {
            $value .= substr($this->nextLine(), 1);
        }

        return $value;
    }
1016008
public function getNameByValue($value)
    {
        $i = array_search($value, $this->__data, true);
        if($i===false)
        {
            return null;
        }
        return $i;
    }