azjezz/psl
PSL is a modern, well-typed standard library for PHP 8.4+, inspired by HHVM’s HSL. It offers safer, predictable APIs for async, collections, networking, I/O, crypto, terminal UI, and robust data validation—replacing brittle built-ins with consistent alternatives.
The Filesystem component provides type-safe functions for common file system operations. It replaces PHP's procedural file functions with proper error handling through exceptions, clear parameter types, and consistent behavior.
Unlike the File component (which deals with reading and writing file contents through handles), Filesystem focuses on managing files and directories themselves: checking existence, creating, copying, deleting, and inspecting metadata.
@example('io/filesystem-exists.php')
@example('io/filesystem-create.php')
@example('io/filesystem-copy-delete.php')
@example('io/filesystem-metadata.php')
@example('io/filesystem-symlinks.php')
@example('io/filesystem-paths.php')
@example('io/filesystem-read-directory.php')
All operations throw specific exceptions on failure:
@example('io/filesystem-error-handling.php')
See src/Psl/Filesystem/ for the full API.
How can I help you explore Laravel packages today?