* @param string $delim
* @param string $subject
*/
- function __construct( $delim, $subject ) {
+ public function __construct( $delim, $subject ) {
$this->subject = $subject;
$this->delim = $delim;
$this->rewind();
}
- function rewind() {
+ public function rewind() {
$this->curPos = 0;
$this->endPos = strpos( $this->subject, $this->delim );
$this->refreshCurrent();
}
- function refreshCurrent() {
+ public function refreshCurrent() {
if ( $this->curPos === false ) {
$this->current = false;
} elseif ( $this->curPos >= $this->subjectLength ) {
}
}
- function current() {
+ public function current() {
return $this->current;
}
/**
* @return int|bool Current position or boolean false if invalid
*/
- function key() {
+ public function key() {
return $this->curPos;
}
/**
* @return string
*/
- function next() {
+ public function next() {
if ( $this->endPos === false ) {
$this->curPos = false;
} else {
/**
* @return bool
*/
- function valid() {
+ public function valid() {
return $this->curPos !== false;
}
}