summaryrefslogtreecommitdiff
path: root/ext/intl/breakiterator/breakiterator_class.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-26 16:42:49 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-06-24 15:31:41 +0200
commitff19ec2df3ef0dca8c29be83eddcde58234f4095 (patch)
treebc6477f4f4e696cf599ec82a0a6dbf221bc5bc10 /ext/intl/breakiterator/breakiterator_class.cpp
parent4730b06f1d026047c63980298d358e28e2183de6 (diff)
downloadphp-git-ff19ec2df3ef0dca8c29be83eddcde58234f4095.tar.gz
Introduce InternalIterator
Userland classes that implement Traversable must do so either through Iterator or IteratorAggregate. The same requirement does not exist for internal classes: They can implement the internal get_iterator mechanism, without exposing either the Iterator or IteratorAggregate APIs. This makes them usable in get_iterator(), but incompatible with any Iterator based APIs. A lot of internal classes do this, because exposing the userland APIs is simply a lot of work. This patch alleviates this issue by providing a generic InternalIterator class, which acts as an adapater between get_iterator and Iterator, and can be easily used by many internal classes. At the same time, we extend the requirement that Traversable implies Iterator or IteratorAggregate to internal classes as well. Closes GH-5216.
Diffstat (limited to 'ext/intl/breakiterator/breakiterator_class.cpp')
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index 6267eb0fa2..2114ada558 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -236,8 +236,7 @@ U_CFUNC void breakiterator_register_BreakIterator_class(void)
BreakIterator_handlers.get_debug_info = BreakIterator_get_debug_info;
BreakIterator_handlers.free_obj = BreakIterator_objects_free;
- zend_class_implements(BreakIterator_ce_ptr, 1,
- zend_ce_traversable);
+ zend_class_implements(BreakIterator_ce_ptr, 1, zend_ce_aggregate);
zend_declare_class_constant_long(BreakIterator_ce_ptr,
"DONE", sizeof("DONE") - 1, BreakIterator::DONE );