items) . '$/Di'); } /** * Validate and normalize a scheme name to lowercase, or throw an exception if invalid * * @link http://tools.ietf.org/html/rfc3986#section-3.1 * * @param string $scheme URL scheme, e.g. "file" or "ed2k" * @return string */ public function normalizeValue($scheme) { if (!preg_match('#^[a-z][a-z0-9+\\-.]*$#Di', $scheme)) { throw new InvalidArgumentException("Invalid scheme name '" . $scheme . "'"); } return strtolower($scheme); } }