Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Rename Zend/Http/Header/AbstractLocation methods uri() and getUri() #74

Open
GeeH opened this issue Jun 28, 2016 · 1 comment
Open

Rename Zend/Http/Header/AbstractLocation methods uri() and getUri() #74

GeeH opened this issue Jun 28, 2016 · 1 comment
Labels

Comments

@GeeH
Copy link
Contributor

GeeH commented Jun 28, 2016

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: zendframework/zendframework#7283
User: @27cm
Created On: 2015-03-01T10:25:28Z
Updated At: 2015-11-06T20:54:28Z
Body
I propose to rename AbstractLocation methods according to Http/Request methods: getUri() to getUriString(), uri() to getUri().

Zend/Http/Request:

/**
 * Return the URI for this request object
 *
 * @return HttpUri
 */
public function getUri()
{
    if ($this->uri === null || is_string($this->uri)) {
        $this->uri = new HttpUri($this->uri);
    }
    return $this->uri;
}

/**
 * Return the URI for this request object as a string
 *
 * @return string
 */
public function getUriString()
{
    if ($this->uri instanceof HttpUri) {
        return $this->uri->toString();
    }
    return $this->uri;
}

Zend/Http/Header/AbstractLocation:

/**
 * Return the URI for this header as an instance of Zend\Uri\Http
 *
 * @return UriInterface
 */
public function uri()
{
    if ($this->uri === null || is_string($this->uri)) {
        $this->uri = UriFactory::factory($this->uri);
    }
    return $this->uri;
}

/**
 * Return the URI for this header
 *
 * @return string
 */
public function getUri()
{
    if ($this->uri instanceof UriInterface) {
        return $this->uri->toString();
    }
    return $this->uri;
}

Comment

User: @liufang
Created On: 2015-03-03T00:40:07Z
Updated At: 2015-03-03T00:40:07Z
Body
Retain only a geturi

$this->getUri(); //return object
(string)$this->getUri(); // string


@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at laminas/laminas-http#9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants