PHP Класс VCR\Storage\AbstractStorage

A Storage can be iterated using standard loops. New recordings can be stored.
Наследование: implements VCR\Storage\Storage
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$current Current parsed record.
$filePath Path to storage file.
$handle File handle.
$isEOF True when parser is at the end of the file.
$isNew If the cassette file is new.
$isValidPosition If the current position is valid.
$position Number of the current recording.

Открытые методы

Метод Описание
__construct ( string $cassettePath, string $cassetteName, string $defaultContent = '[]' ) Creates a new file store.
__destruct ( ) Closes file handle.
current ( ) : array Returns the current record.
isNew ( ) : boolean Returns true if the file did not exist and had to be created.
key ( ) : integer Returns the current key.

Описание методов

__construct() публичный Метод

If the cassetteName contains PATH_SEPARATORs, subfolders of the cassettePath are autocreated when not existing.
public __construct ( string $cassettePath, string $cassetteName, string $defaultContent = '[]' )
$cassettePath string Path to the cassette directory.
$cassetteName string Path to the cassette file, relative to the path.
$defaultContent string Default data for this cassette if its not existing

__destruct() публичный Метод

Closes file handle.
public __destruct ( )

current() публичный Метод

Returns the current record.
public current ( ) : array
Результат array Parsed current record.

isNew() публичный Метод

Returns true if the file did not exist and had to be created.
public isNew ( ) : boolean
Результат boolean TRUE if created, FALSE if not

key() публичный Метод

Returns the current key.
public key ( ) : integer
Результат integer

Описание свойств

$current защищенное свойство

Current parsed record.
protected $current

$filePath защищенное свойство

Path to storage file.
protected $filePath

$handle защищенное свойство

File handle.
protected $handle

$isEOF защищенное свойство

True when parser is at the end of the file.
protected $isEOF

$isNew защищенное свойство

If the cassette file is new.
protected $isNew

$isValidPosition защищенное свойство

If the current position is valid.
protected $isValidPosition

$position защищенное свойство

Number of the current recording.
protected $position