\Omega\Filesystem\Contracts FileFactoryInterface

Interface for a class responsible for file creation.

This interface defines a method for creating instances of the File class. It provides a contract for factories that instantiate files with a specific key and filesystem context.

Summary

Methods
Constants
createFile()
No public constants found

Methods

createFile()

createFile(string  $key, \Omega\Filesystem\Filesystem  $filesystem) : \Omega\Filesystem\File

Creates a new File instance.

This method is responsible for generating a new File object using the specified file key and the associated Filesystem instance. It abstracts the logic of file creation, allowing different implementations based on the specific requirements of the application.

Parameters

string $key

The unique key that identifies the file in the filesystem.

\Omega\Filesystem\Filesystem $filesystem

The filesystem instance that will manage the file.

Returns

\Omega\Filesystem\File —

Returns a new instance of the File class.