PHP Class Asvae\ApiTester\Storages\JsonStorage

Inheritance: implements Asvae\ApiTester\Contracts\StorageInterface
Datei anzeigen Open project: asvae/laravel-api-tester

Protected Properties

Property Type Description
$collection Asvae\ApiTester\Collections\RequestCollection
$filename
$files
$path

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files, RequestCollection $collection, $path ) Storage constructor.
get ( ) : RequestCollection Return array parsed from file content.
getFilePath ( ) : string Return full file path.
getFilename ( ) : string
getPath ( ) : string Return path to folder that can contain file.
put ( RequestCollection $data ) : void

Protected Methods

Method Description
createDirectoryIfNotExists ( ) Make directory path if not exists
parseResult ( $content ) : array Parse result form given string

Private Methods

Method Description
convertToJson ( $data ) : null | string
makeCollection ( array $data = [] ) : RequestCollection
prepareContent ( Traversable | array $data ) : string Prepare content string from given data

Method Details

__construct() public method

Storage constructor.
public __construct ( Illuminate\Filesystem\Filesystem $files, RequestCollection $collection, $path )
$files Illuminate\Filesystem\Filesystem
$collection Asvae\ApiTester\Collections\RequestCollection
$path

createDirectoryIfNotExists() protected method

Make directory path if not exists

get() public method

Return array parsed from file content.
public get ( ) : RequestCollection
return Asvae\ApiTester\Collections\RequestCollection

getFilePath() public method

Return full file path.
public getFilePath ( ) : string
return string

getFilename() public method

public getFilename ( ) : string
return string

getPath() public method

Return path to folder that can contain file.
public getPath ( ) : string
return string

parseResult() protected method

Parse result form given string
protected parseResult ( $content ) : array
$content
return array

put() public method

public put ( RequestCollection $data ) : void
$data Asvae\ApiTester\Collections\RequestCollection
return void

Property Details

$collection protected_oe property

protected RequestCollection,Asvae\ApiTester\Collections $collection
return Asvae\ApiTester\Collections\RequestCollection

$filename protected_oe property

protected $filename

$files protected_oe property

protected $files

$path protected_oe property

protected $path