function current() { $xml = parent::current(); if (isset($xml[0])) { $tasks = array(); $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), parent::key()); $task = str_replace(' ', '/', ucwords($task)); $task = str_replace('/', '_', $task); $task = '\\Pyrus\\Task\\' . $task; foreach ($xml as $info) { $attribs = array(); if (isset($xml['attribs'])) { $attribs = $xml['attribs']; } $tasks[] = new $task($this->_parent, $this->_installphase, $info, $attribs, $this->lastversion); } $attribs = isset($this->_inner['attribs']) ? array($this->_inner['attribs']) : $this->_inner; // use proxy for multiple tasks return new \Pyrus\Task\MultipleProxy($this->_parent, $tasks, $attribs, $this->key()); } $attribs = array(); if (isset($xml['attribs'])) { $attribs = $xml['attribs']; } $task = \Pyrus\Task\Common::getTask(parent::key()); if ($task === false) { throw new \RuntimeException('Unknown task `' . parent::key() . '` specified.'); } return new $task($this->_parent, $this->_installphase, $xml, $attribs, $this->lastversion); }
/** * {@inheritdoc} */ public function accept() { if ($this->status === NULL) { return TRUE; } return $this->status == parent::current()->getStatus(); }
public function accept() { $currentLine = parent::current(); if (substr($currentLine, 0, 15) === self::BEGIN_SAMPLE_MARKER) { $this->isSampleText = true; return false; } if (substr($currentLine, 0, 13) === self::END_SAMPLE_MARKER) { $this->isSampleText = false; return false; } if ($this->isSampleText) { return true; } if ($this->addAllSectionMarkers) { if ($this->lineIsSectionMarker($currentLine)) { $this->previousLineWasSectionMarker = true; return true; } if ($this->previousLineWasSectionMarker) { $this->previousLineWasSectionMarker = false; return true; } } return false; }
/** * {@inheritdoc} */ public function accept() { if (null === $this->status) { return true; } return $this->status == parent::current()->getStatus(); }
function current() { $xml = parent::current(); if (isset($xml[0])) { $tasks = array(); $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), parent::key()); $task = str_replace(' ', '/', ucwords($task)); $task = str_replace('/', '_', $task); $task = '\PEAR2\Pyrus\Task\\' . $task; foreach ($xml as $info) { $attribs = array(); if (isset($xml['attribs'])) { $attribs = $xml['attribs']; } $tasks[] = new $task($this->_parent, $this->_installphase, $info, $attribs, $this->lastversion); } $attribs = isset($this->_inner['attribs']) ? array($this->_inner['attribs']) : $this->_inner; // use proxy for multiple tasks return new \PEAR2\Pyrus\Task\MultipleProxy($this->_parent, $tasks, $attribs, $this->key()); } $attribs = array(); if (isset($xml['attribs'])) { $attribs = $xml['attribs']; } $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), parent::key()); $task = str_replace(' ', '/', ucwords($task)); $task = str_replace('/', '_', $task); $task = '\PEAR2\Pyrus\Task\\' . $task; return new $task($this->_parent, $this->_installphase, $xml, $attribs, $this->lastversion); }
public function accept() { $return = true; if ($this->_filter['filterField'] && $this->_filter['filterCompare']) { $filterValue = $this->_filter['filterValue']; switch ($this->_filter['filterField']) { case 'price': $value = parent::current()->getPrice(); break; case 'code': $value = parent::current()->getCode(); break; case 'name': $value = parent::current()->getName(); break; default: $value = false; break; } switch ($this->_filter['filterCompare']) { case 'ilike': $return = $value == $filterValue; break; case 'bigger': $return = $value > $filterValue; break; case 'smaller': $return = $value < $filterValue; break; } } return $return; }
public function current() { $tag = parent::current(); if ($tag) { $tag = substr($tag, 6); } return $tag; }
/** * accept() * * accept caller for a filter iterator * * @return bool */ public function accept() { foreach ($this->filter as $name => $filter) { if (false === $filter->get($name)->filter($this->routeValues[$name], parent::current())) { return false; } } return true; }
/** * Check whether the current element of the iterator is acceptable * * @link http://php.net/manual/en/filteriterator.accept.php * @return bool true if the current element is acceptable, otherwise false. */ public function accept() { /** * @var \SplFileInfo $current */ $current = parent::current(); if (!$current->isDir()) { return false; } }
/** * {@inheritdoc} */ public function current() { $item = parent::current(); unset($item['use_as_label']); if (isset($item['type'])) { if (isset($this->attributeTypes[$item['type']])) { $item['type'] = $this->attributeTypes[$item['type']]; } } return $item; }
/** * {@inheritdoc} */ public function accept() { if (null === $this->active) { return true; } $item = parent::current(); if (in_array($item->getId(), $this->active)) { $item->setAttribute('active', true); } return true; }
function current() { $file = $this->key(); $curfile = parent::current(); if (isset(self::$_installGroup['install'][$file])) { // add the install-as attribute for these files $curfile['attribs']['install-as'] = self::$_installGroup['install'][$file]; } if ($b = self::$_parent->getBaseInstallDir($file)) { $curfile['attribs']['baseinstalldir'] = $b; } return new FileTag($curfile, '', self::$_parent); }
/** * Match php upgrade scripts * * @return Boolean */ public function accept() { $filePath = parent::current()->getPathname(); $match = true; foreach ($this->includePaths as $path) { $match &= strpos($filePath, $path) !== false; } foreach ($this->excludePaths as $path) { $match &= !(strpos($filePath, $path) !== false); } $match &= preg_match('%^[0-9]+_(.*)\\.php$%', basename($filePath)); return $match; }
/** * ( excerpt from http://php.net/manual/en/regexiterator.accept.php ) * * Matches (string) RegexIterator::current() (or RegexIterator::key() if * the RegexIterator::USE_KEY flag is set) against the regular expression. * * @return boolean TRUE if a match, FALSE otherwise. */ public function accept() { $this->key = parent::key(); $this->current = parent::current(); $matches = array(); $useKey = $this->flags & self::USE_KEY; $subject = $useKey ? (string) $this->key : (string) $this->current; switch ($this->mode) { case self::MATCH: $ret = preg_match($this->regex, $subject, $matches, $this->pregFlags) > 0; break; case self::GET_MATCH: $this->current = array(); $ret = preg_match($this->regex, $subject, $this->current, $this->pregFlags) > 0; break; case self::ALL_MATCHES: $this->current = array(); preg_match_all($this->regex, $subject, $this->current, $this->pregFlags); $ret = count($this->current) > 0; break; case self::SPLIT: $this->current = preg_split($this->regex, $subject, null, $this->pregFlags); $ret = $this->current && count($this->current) > 1; break; case self::REPLACE: $replace_count = 0; $result = preg_replace($this->regex, $this->replacement, $subject, -1, $replace_count); if ($result === null || $replace_count == 0) { $ret = false; break; } if ($useKey) { $this->key = $result; $ret = true; break; } $this->current = $result; $ret = true; break; default: $ret = false; break; } if ($this->flags & self::INVERT_MATCH) { return !$ret; } else { return $ret; } }
/** Call the filter callback * @return result of filter callback */ public function accept() { $this->key = parent::key(); $this->current = parent::current(); switch ($this->mode) { default: case self::USE_FALSE: return false; case self::USE_TRUE: return true; case self::USE_VALUE: return (bool) call_user_func($this->callback, $this->current); case self::USE_KEY: return (bool) call_user_func($this->callback, $this->key); case self::USE_BOTH: return (bool) call_user_func($this->callback, $this->key, $this->current); } }
/** * Check whether the current element of the iterator is acceptable * * @link http://php.net/manual/en/filteriterator.accept.php * @return bool true if the current element is acceptable, otherwise false. */ public function accept() { /** * @var \SplFileInfo $current */ $current = parent::current(); if ($current->isDir()) { return false; } if (!preg_match($this->glob, $current->getFilename())) { return false; } if (empty($this->excludedList)) { return true; } foreach ($this->excludedList as $regExp) { if (preg_match($regExp, $current->getFilename())) { return false; } } return true; }
/** * accept() * * accept caller for a filter iterator * * @return bool */ public function accept() { $data = $this->getInnerIterator()->offsetGet(parent::current())['data']; return (bool) preg_match('~^' . $data['regex'] . '$~', $this->pathInfo); }
public function current() { return new Iterator\Spec(parent::current(), $this->suite, $this->basePath); }
/** * Returns an instance of {@link phpucInputI}. * * @return phpucInputI */ public function current() { $key = $this->key(); if (!isset($this->inputs[$key])) { // Build class name from file $class = 'phpuc' . pathinfo(parent::current(), PATHINFO_FILENAME); $this->inputs[$key] = new $class(); } return $this->inputs[$key]; }
public function current() { $token = parent::current(); return $token->getMessages(); }
/** * Checks if the current element is accepted. * * @return boolean */ public function accept() { return !VendorResources::isVendorFile(parent::current()); }
public function accept() { /* @var Trip $trip */ $trip = parent::current(); return $trip->getDepartureTime() > $this->dateTime; }
public function current() { return __DIR__ . '/db/' . parent::current(); }
/** * {@inheritdoc} */ public function accept() { return !isset($this->options['access']) or !$this->options['access'] or parent::current()->hasAccess($this['user']); }
public function accept() { return !in_array((string) parent::current()->getId(), $this->skipped); }
/** * * @see FilterIterator::current() */ public function current() { $value = parent::current(); if (is_string($value)) { $value = trim($value); } return $value; }
public function accept() { //$fileInfo = $this->getInnerIterator()->getSubIterator()->getFileInfo(); $current = parent::current(); // Don't crawl hidden dirs or files $is_hidden_test = preg_match('/(^|[\\/])\\.[^\\/.]/', $current); if ($is_hidden_test === FALSE or $is_hidden_test > 0) { return FALSE; } // Accept only .php files if (substr($current, -4) !== '.php') { return FALSE; } return TRUE; }
public function current() { return parent::current()->getName(); }
/** * accept() * * accept caller for a filter iterator * * @return bool */ public function accept() { return parent::current()->getName() === $this->name; }
/** * Only accept conferences, ie, events with sufficient talks. * * @return bool */ public function accept() { $item = parent::current(); return isset($item['talks_count']) && $item['talks_count'] >= static::CONFERENCE_MIN_TALKS; }