/**
 * Get the file type of a given file.
 *
 * @return string The file type of a given file.
 */
public function type(): string

Examples

$result1 = $filesystem->file('/foo/1.txt')->type();
$result2 = $filesystem->file('/foo/1')->type();

echo $result1;
echo $result2;

The above example will output:

file

dir

Getting Started

Methods

Filesystem
File
Directory