rfc:functional-elements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:functional-elements [2008/03/16 14:09] – Adding use case titles lstrojny | rfc:functional-elements [2008/03/17 09:33] – Adding modified use cases lstrojny | ||
---|---|---|---|
Line 20: | Line 20: | ||
</ | </ | ||
- | === UC-3: Iterating over an aggregtion | + | === UC-3: Iterating over an aggregation |
<code php> | <code php> | ||
foreach ($list as $element) { | foreach ($list as $element) { | ||
Line 39: | Line 39: | ||
</ | </ | ||
- | ==== Extracted functions ==== | ||
- | === spl_iterator_element_call() === | ||
- | <code php> | ||
- | array|bool spl_iterator_element_call( | ||
- | array|Iterator $iterator, | ||
- | string|array $methods, | ||
- | array $params = array(), | ||
- | bool $collect = true | ||
- | ) | ||
- | </ | ||
- | Iterating | + | ==== Required functionality ==== |
- | <code php> | + | Extracting the required functionality to leads to the following required additions: |
- | $result = spl_iterator_element_call($list, ' | + | * [[rfc: |
- | </ | + | * [[rfc:: |
+ | * [[rfc: | ||
+ | * function iterator_true(): Walks over a traversable list and assumes every element to be true | ||
+ | * function iterator_false(): | ||
- | Iterating over a list of objects, call methods " | + | ==== Modified use cases ==== |
+ | === UC-1: Iterating over an aggregation | ||
<code php> | <code php> | ||
- | $result = spl_iterator_element_call($list, array(' | + | iterate(new CallIterator($list, 'method')); |
</ | </ | ||
- | Iterating over a list of objects, call method ' | ||
- | <code php> | ||
- | $result = spl_iterator_element_call($list, | ||
- | </ | ||
- | |||
- | === spl_iterator_element_call_conditional() === | ||
- | <code php> | ||
- | array|mixed spl_iterator_element_call_conditional( | ||
- | array|Iterator $iterator, | ||
- | string|array $methods, | ||
- | string|array $conditions, | ||
- | array $params = array(), | ||
- | array $condition_params = array(), | ||
- | bool $collect = true, | ||
- | bool $finite = true | ||
- | ) | ||
- | </ |
rfc/functional-elements.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1