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

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

Description

@GeeH

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


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions