# FileInterface

Chevere\Interfaces\Filesystem\FileInterface

view source

# Description

Describes the component in charge of interacting with filesystem files.

# Constants

# CHECKSUM_ALGO

Type string

'sha256'

# CHECKSUM_LENGTH

Type integer

64

# Methods

# __construct()

# Parameters

  1. PathInterface $path

# path()

Provides access to the PathInterface instance.


# isPhp()

Returns a boolean indicating whether the file name is a PHP file.

RETURN

bool


# exists()

Returns a boolean indicating whether the file exists.

RETURN

bool


# assertExists()

RETURN

void


# checksum()

Retrieves the file checksum using the CHECKSUM_ALGO algorithm.

RETURN

string


# contents()

Retrieves the file contents.

RETURN

string


# remove()

Remove the file.

RETURN

void


# create()

Create the file.

RETURN

void


# put()

Put contents to the file. If the file doesn't exists it will be created.

# Parameters

  1. string $contents

RETURN

void


Last Updated: 8/2/2020, 1:36:58 AM