PHP Class nspl\ds\Collection

Inheritance: implements ArrayAccess, implements Iterator, implements Countable
Show file Open project: ihor/Nspl

Protected Properties

Property Type Description
$array array
$valid integer

Public Methods

Method Description
__toString ( ) : string
count ( ) : integer
current ( ) : mixed (PHP 5 >= 5.0.0)
Return the current element
key ( ) : mixed (PHP 5 >= 5.0.0)
Return the key of the current element
next ( ) : void (PHP 5 >= 5.0.0)
Move forward to next element
offsetExists ( mixed $index ) : boolean (PHP 5 >= 5.0.0)
Whether a offset exists
offsetGet ( integer $index ) : mixed (PHP 5 >= 5.0.0)
Offset to retrieve
offsetSet ( integer $index, mixed $value ) : void (PHP 5 >= 5.0.0)
Offset to set
offsetUnset ( integer $index ) : void (PHP 5 >= 5.0.0)
Offset to unset
rewind ( ) : void (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
toArray ( ) : array
valid ( ) : boolean (PHP 5 >= 5.0.0)
Checks if current position is valid

Protected Methods

Method Description
stringifyArray ( array $array ) region __toString

Method Details

__toString() public method

public __toString ( ) : string
return string

count() public method

public count ( ) : integer
return integer

current() public method

(PHP 5 >= 5.0.0)
Return the current element
public current ( ) : mixed
return mixed Can return any type.

key() public method

(PHP 5 >= 5.0.0)
Return the key of the current element
public key ( ) : mixed
return mixed scalar on success, or null on failure.

next() public method

(PHP 5 >= 5.0.0)
Move forward to next element
public next ( ) : void
return void Any returned value is ignored.

offsetExists() public method

(PHP 5 >= 5.0.0)
Whether a offset exists
public offsetExists ( mixed $index ) : boolean
$index mixed

An offset to check for.

return boolean true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

offsetGet() public method

(PHP 5 >= 5.0.0)
Offset to retrieve
public offsetGet ( integer $index ) : mixed
$index integer

The offset to retrieve.

return mixed Can return all value types.

offsetSet() public method

(PHP 5 >= 5.0.0)
Offset to set
public offsetSet ( integer $index, mixed $value ) : void
$index integer

The offset to assign the value to.

$value mixed

The value to set.

return void

offsetUnset() public method

(PHP 5 >= 5.0.0)
Offset to unset
public offsetUnset ( integer $index ) : void
$index integer

The offset to unset.

return void

rewind() public method

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
public rewind ( ) : void
return void Any returned value is ignored.

stringifyArray() protected method

region __toString
protected stringifyArray ( array $array )
$array array

toArray() public method

public toArray ( ) : array
return array

valid() public method

(PHP 5 >= 5.0.0)
Checks if current position is valid
public valid ( ) : boolean
return boolean The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

Property Details

$array protected property

protected array $array
return array

$valid protected property

protected int $valid
return integer