Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
weierophinney opened this issue Dec 31, 2019 · 1 comment
Closed
Labels

Comments

@weierophinney
Copy link
Member

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



Originally posted by @GeeH at zendframework/zend-http#74

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

You can continue using laminas/laminas-http safely.
Its successor will be PSR-7 in a later revision of laminas/laminas-mvc.

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

No branches or pull requests

1 participant