Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
composing objects and make methods and objects testable
require_once __DIR__ . '/../vendor/autoload.php';
$uploadHandler = new \Acme\FileUpload\UploadHandler();
->setTargetDirectory(__DIR__ . '/../uploads')
->addValidator(new JpegFileTypeValidator())
->addValidator(new maxFileSizeValidator(4096))
->addValidator(new fileExistsValidator()); // don't overwrite existing uploads
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.