本文整理汇总了PHP中Iterator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Iterator::__construct方法的具体用法?PHP Iterator::__construct怎么用?PHP Iterator::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Iterator
的用法示例。
在下文中一共展示了Iterator::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($declarations_string, Rule $rule)
{
parent::__construct();
$pairs = DeclarationList::parse($declarations_string);
foreach ($pairs as $index => $pair) {
list($prop, $value) = $pair;
// Directives.
if ($prop === 'extends') {
$rule->setExtendSelectors($value);
unset($pairs[$index]);
} elseif ($prop === 'name') {
if (!$rule->name) {
$rule->name = $value;
}
unset($pairs[$index]);
}
}
// Build declaration list.
foreach ($pairs as $index => &$pair) {
list($prop, $value) = $pair;
if (trim($value) !== '') {
if ($prop === 'mixin') {
$this->flattened = false;
$this->store[] = $pair;
} else {
// Only store to $this->data if the value does not itself make a
// this() call to avoid circular references.
if (!preg_match(Regex::$patt->thisFunction, $value)) {
$this->data[strtolower($prop)] = $value;
}
$this->add($prop, $value, $index);
}
}
}
}
示例2: __construct
public function __construct($selectorString, Rule $rule)
{
parent::__construct();
$selectorString = trim(Util::stripCommentTokens($selectorString));
foreach (Util::splitDelimList($selectorString) as $selector) {
if (preg_match(Regex::$patt->abstract, $selector, $m)) {
$rule->name = strtolower($m['name']);
$rule->isAbstract = true;
} else {
$this->add(new Selector($selector));
}
}
}
示例3: __construct
/**
* @param string $chunk
* @param int $stackSize
*/
public function __construct($chunk, $stackSize = 8)
{
parent::__construct(new \ArrayIterator(StringUtils::toArray($chunk)), $stackSize);
}
示例4: __construct
public function __construct(IIterator $iterator)
{
parent::__construct();
$this->outerIterator = $iterator;
}