WordPress\AiClientDependencies\Nyholm\Psr7
Uri::withUserInfo
Метод класса: Uri{}
Хуков нет.
Возвращает
static.
Использование
$Uri = new Uri(); $Uri->withUserInfo( $user, $password ): UriInterface;
- $user(обязательный)
- .
- $password
- .
По умолчанию:null
Код Uri::withUserInfo() Uri::withUserInfo WP 7.1.2
public function withUserInfo($user, $password = null): UriInterface
{
if (!\is_string($user)) {
throw new \InvalidArgumentException('User must be a string');
}
$info = \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $user);
if (null !== $password && '' !== $password) {
if (!\is_string($password)) {
throw new \InvalidArgumentException('Password must be a string');
}
$info .= ':' . \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $password);
}
if ($this->userInfo === $info) {
return $this;
}
$new = clone $this;
$new->userInfo = $info;
return $new;
}