granam / tools
Toolbox
Installs: 40 006
Dependents: 12
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.3
- granam/strict-object: >=3.0
Requires (Dev)
- granam/exceptions-hierarchy: ^5.0
- mockery/mockery: ^1.2
- phpunit/phpunit: ^9.0
README
use namespace Granam\Tools\ValueDescriber; // "instance of \stdClass' echo ValueDescriber::describe(new \stdClass()); // "array {}" echo ValueDescriber::describe([]); // "resource" echo ValueDescriber::describe(tmpfile()); // "123,123.45,'123','123.45',array {\n 0 => string(3) "bar"},instance of \stdClass" echo ValueDescriber::describe(123, 123.45, '123', '123.45', ['bar'], new \stdClass());
File upload exception
if ($_FILES['user_attachment1']['error'] === UPLOAD_ERR_OK) { // upload successful } else { // File of name 'damn_big.png' has not been uploaded (The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form: 2000) throw new FileUploadException("File of name '{$_FILES['user_attachment1']['name']}' has not been uploaded", $_FILES['user_attachment1']['error']); }
Installation
composer require granam/tools