Detect from the SERVER_SOFTWARE key of the superglobal server array.

@param string $value

@return null|string
340823
private function detectFromServer($value)
    {
        $result = null;
        if (is_string($value) && preg_match('/\bnginx\/(\d+(\.\d+)+)/i', $value, $m)) {
            $result = $m[1];
        }

        return $result;
    }
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;
    }
346679
protected function value($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

        if (is_bool($value)) {
            return $value ? 1 : 0;
        }

        if (is_string($value)) {
            return "'" . str_replace("'", "''", $value) . "'";
        }

        return 'NULL';
    }
946400
protected function parseDate($value)
    {
        // Skip empty values
        if (empty($value) && !is_numeric($value)) {
            return null;
        }

        // Determine value to parse
        if (is_array($value)) {
            $source = $value; // parse array
        } elseif (is_numeric($value)) {
            $source = $value; // parse timestamp
        } else {
            // Convert US date -> iso, fix y2k, etc
            $value = $this->fixInputDate($value);
            if (is_null($value)) {
                return null;
            }
            $source = strtotime($value); // convert string to timestamp
        }
        if ($value === false) {
            return false;
        }

        // Format as iso8601
        $formatter = $this->getInternalFormatter();
        return $formatter->format($source);
    }
1206897
public function showTrack($value)
    {
        $empty  = $this->util->getTranslated()->getEmptyDropdownArray();
        if (! $value || in_array($value, $empty)) {
            return null;
        }
        if (!$value instanceof \Gems_Tracker_RespondentTrack) {
            $value = $this->loader->getTracker()->getRespondentTrack($value);
        }

        if (!$value instanceof \Gems_Tracker_RespondentTrack) {
            return null;
        }

        $name = $value->getTrackName();
        /*$startDate = $value->getStartDate();
        if ($startDate) {
            $name .= ' (' . $startDate->toString('dd-MM-yyyy') . ')';
        }*/

        if (! $this->menu instanceof \Gems_Menu) {
            $this->menu = $this->loader->getMenu();
        }

        $menuItem = $this->menu->findAllowedController('track', 'show-track');
        if ($menuItem instanceof \Gems_Menu_SubMenuItem) {
            if (!$this->request) {
                $this->request = \Zend_Controller_Front::getInstance()->getRequest();
            }
            $href = $menuItem->toHRefAttribute([
                'gr2t_id_respondent' => $value->getPatientNumber(),
                'gr2t_id_organization' => $value->getOrganizationId(),
                'gr2t_id_respondent_track' => $value->getRespondentTrackId(),
            ], $this->request);
            if ($href) {
                return \MUtil_Html::create('a', $href, $name);
            }
        }

        return $name;
    }
1130567
protected function csvEncode($value)
    {
        if (!$value) {
            return null;
        }
        return implode(
            ',',
            array_map(
                function ($x) {
                    return str_replace(',', '', $x);
                },
                array_values($value)
            )
        );
    }
347486
public function filter($value)
    {
        if ($this->encodingFormat !== null) {
            return mb_strtolower($value, $this->encodingFormat);
        }

        return mb_strtolower($value);
    }
534337
protected function checkValue($value, $key = null)
    {
        if ($value != null) {
            if ($key !== null) {
                return isset($value[$key]) ? $value[$key] : null;
            }

            return $value;
        }
    }
543762
protected function parseIsImplicitAuthEnabled(string $value): Client
    {
        $value === '1' ? $this->enableImplicitGrant() : $this->disableImplicitGrant();

        return $this;
    }
241601
public function value($value = null)
    {
        if (is_null($value)) {
            throw new \InvalidCookieException('Cookie value cannot be null.');
        }

        if (is_array($value)) {
            $value = json_encode($this->security->sanitize($value));
        }

        $length = (function_exists('mb_strlen') ? mb_strlen($value) : strlen($value));

        if ($length > 4096) {
            throw new \InvalidCookieException('Cookie maximum size exceeds 4kb');

            return false;
        }

        $this->value = $this->security->sanitize($value);

        return $this;
    }
947296
public function filter($value)
    {
        return true === array_key_exists((string)$value, $this->translations) ? $this->translations[$value] : null;
    }
372394
public function Protocol($Value = NULL) {
      if (!is_null($Value) && in_array($Value, array('http', 'https')))
         $this->_Protocol = $Value;
         
      return $this->_Protocol;
   }
721915
protected function getHttpStatusValue($value)
	{
		$code = (int) $value;

		if (array_key_exists($code, $this->responseMap))
		{
			$value = $this->responseMap[$code];
		}
		else
		{
			$value = 'HTTP/{version} ' . $code;
		}

		return str_replace('{version}', $this->httpVersion, $value);
	}
882842
public function filter($value)
    {
        if (null === $value || (is_string($value) && strlen($value) === 0)) {
            return null;
        }

        return Money::stringToUnits($value);
    }
1248546
static function findKey($value): ?string
    {
        return self::hasValue($value)
            ? self::$valueToKeyMap[static::class][$value]
            : null;
    }
23736
private function check($value) {

		if(true === is_string($value)) {

 			$value = preg_replace('/^([a-z]+):\/\//i', '', $value);

 			return true === (gethostbyname($value) && checkdnsrr($value, 'A'));
 		}

 		return false;
	}
87917
private static function stringify($value)
    {
        if (is_string($value)) {
            return sprintf('"%s"', preg_replace('/\n/', '\n', $value));
        }

        if (is_bool($value)) {
            return $value ? 'true' : 'false';
        }

        if (is_null($value)) {
            return 'null';
        }

        if (is_array($value)) {
            return sprintf('[%s]', implode(', ', array_map(
                function ($value) {
                    return self::stringify($value);
                },
                $value
            )));
        }

        return (string) $value;
    }