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

Real strings from StaticStringy #138

Conversation

alexeyshockov
Copy link
Contributor

I think that it's good to produce real strings from StaticStringy, not Stringy object that can be casted to a string.

Example situation: I do some manipulation with a string with StaticStringy, then assign the result to base_uri option of Guzzle client. After that I get "URI must be a string or UriInterface" error.

With PHP 7 it's even more important, because of scalar type hinting.

@danielstjules
Copy link
Owner

danielstjules commented Jun 13, 2016

Sounds good! Breaks BC with the existing API, so will have to go into a new major release.

@alexeyshockov
Copy link
Contributor Author

Great!

To be honest, it doesn't break documented API... Because all phpDoc comments about return types say that string has to be returned.

But it breaks real API of course :)

@GrahamCampbell
Copy link
Contributor

You need to update the phpdoc.

@alexeyshockov
Copy link
Contributor Author

@GrahamCampbell, which one? Existing phpDoc comments already state that StaticStringy methods return string.

@danielstjules
Copy link
Owner

Existing PHPDocs are wrong, and reflect the API pre-2.x. Not sure when this regression was introduced. It could be marked a bug, but I'd rather play it safe. Current PR is fine, thanks! :)

@danielstjules danielstjules added this to the 3.x milestone Mar 1, 2017
@danielstjules
Copy link
Owner

Merged into the 3.x dev branch #160
Thanks! :)

@alexeyshockov alexeyshockov deleted the real-strings-from-static branch March 6, 2017 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants