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

Changed type hinting from array to ArrayAccess. #1372

Closed
wants to merge 1 commit into from
Closed

Changed type hinting from array to ArrayAccess. #1372

wants to merge 1 commit into from

Conversation

snjypl
Copy link

@snjypl snjypl commented Jan 22, 2016

Because of the type hinting am not able to pass an ArrayObject as a container.

Passing an array is not possible for me, as i will have to pass it around by reference.
and laravel IOC while resolving wont pass the paraments by reference.

the solution i found is to make the container an object ie: ArrayObject, as it will be passed by reference.

But the type hinting was preventing me from doing so.

@jeremeamia
Copy link
Member

As you can see by the test failures in Travis, your proposed change is a breaking change. By changing it to \ArrayAccess, arrays will no longer work.

I you are having trouble with how the Laravel IoC container works with this object, then I suggest wrapping it with a custom object.

jeremeamia added a commit that referenced this pull request Jan 22, 2016
Allows an array or array-accessible object to be used as the history container for the history middleware.
@jeremeamia
Copy link
Member

@codbox How about #1373 as an alternative. This should meet your needs and still be backward-compatible.

@mtdowling
Copy link
Member

Closing in favor of #1373

@mtdowling mtdowling closed this Jan 22, 2016
@snjypl
Copy link
Author

snjypl commented Jan 26, 2016

Thanks, that works great.

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