protected function setRequestDefaults(array $cookies, $host, $path)
    {
        $out = [];
        foreach ($cookies as $name => $cookie) {
            if (!$cookie->getDomain()) {
                $cookie = $cookie->withDomain($host);
            }
            if (!$cookie->getPath()) {
                $cookie = $cookie->withPath($path);
            }
            $out[] = $cookie;
        }

        return $out;
    }
protected function setRequestDefaults(array $cookies, $host, $path)
    {
        $out = [];
        foreach ($cookies as $name => $cookie) {
            if (!$cookie->getDomain()) {
                $cookie = $cookie->withDomain($host);
            }
            if (!$cookie->getPath()) {
                $cookie = $cookie->withPath($path);
            }
            $out[] = $cookie;
        }

        return $out;
    }
protected function setRequestDefaults ( array $ cookies , $ host , $ path ) { $ out = [ ] ; foreach ( $ cookies as $ name => $ cookie ) { if ( ! $ cookie -> getDomain ( ) ) { $ cookie = $ cookie -> withDomain ( $ host ) ; } if ( ! $ cookie -> getPath ( ) ) { $ cookie = $ cookie -> withPath ( $ path ) ; } $ out [ ] = $ cookie ; } return $ out ; }
Apply path and host to the set of cookies if they are not set.

@param array $cookies An array of cookies to update.
@param string $host The host to set.
@param string $path The path to set.
@return array An array of updated cookies.
Apply path and host to the set of cookies if they are not set .