Quantcast
Viewing all articles
Browse latest Browse all 294794

Add first(), get($index) and possibly other methods to ListInterface

Updated: Comment #N

Problem/Motivation

Right now, \Drupal\Core\TypedData\ListInterface only allows access to it's items through \ArrayAccess. That's nice where you can use and I think we should continue to support it, but it would be useful to have better methods instead of offsetGet(0), that's just weird.

Proposed resolution

Add first() and get($index). There's also a method for an toArray() (right now called getValue()), let's leave that out here.

Remaining tasks

Implement it.

User interface changes

None

API changes

Only additions.


Viewing all articles
Browse latest Browse all 294794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>