From 9e8a8513b20cfd770429e35135516c6399444930 Mon Sep 17 00:00:00 2001 From: WubTheCaptain Date: Tue, 15 Sep 2015 17:36:21 +0000 Subject: Indent and format project to PSR-2 style PSR-2 [1] is a highly regarded style guide in the PHP community according to Stack Overflow [2]. The indentation was out of place in the source code. I've seen a combination of 1 space tabs, 3 space tabs, 4 space tabs and 5 space tabs. Some closing braces on the same line and a lot of the code (especially moe code) had reached the point of losing readability. Converted with php-cs-fixer and some hand adjustment. [1]: http://www.php-fig.org/psr/psr-2/ [2]: https://stackoverflow.com/questions/3638083/list-of-highly-regarded -php-style-guides --- static/classes/UploadException.class.php | 92 ++++++++++++++++---------------- 1 file changed, 47 insertions(+), 45 deletions(-) (limited to 'static/classes/UploadException.class.php') diff --git a/static/classes/UploadException.class.php b/static/classes/UploadException.class.php index b1b4839..66be853 100755 --- a/static/classes/UploadException.class.php +++ b/static/classes/UploadException.class.php @@ -1,45 +1,47 @@ -codeToMessage($code); - parent::__construct($message, 500); - } - - private function codeToMessage($code) { - switch ($code) { - case UPLOAD_ERR_INI_SIZE: - $message = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; - break; - case UPLOAD_ERR_FORM_SIZE: - $message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was " . - "specified in the HTML form"; - break; - case UPLOAD_ERR_PARTIAL: - $message = "The uploaded file was only partially uploaded"; - break; - case UPLOAD_ERR_NO_FILE: - $message = "No file was uploaded"; - break; - case UPLOAD_ERR_NO_TMP_DIR: - $message = "Missing a temporary folder"; - break; - case UPLOAD_ERR_CANT_WRITE: - $message = "Failed to write file to disk"; - break; - case UPLOAD_ERR_EXTENSION: - $message = "File upload stopped by extension"; - break; - - default: - $message = "Unknown upload error"; - break; - } - return $message; - } -} - -?> \ No newline at end of file +codeToMessage($code); + parent::__construct($message, 500); + } + + private function codeToMessage($code) + { + switch ($code) { + case UPLOAD_ERR_INI_SIZE: + $message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; + break; + case UPLOAD_ERR_FORM_SIZE: + $message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was '. + 'specified in the HTML form'; + break; + case UPLOAD_ERR_PARTIAL: + $message = 'The uploaded file was only partially uploaded'; + break; + case UPLOAD_ERR_NO_FILE: + $message = 'No file was uploaded'; + break; + case UPLOAD_ERR_NO_TMP_DIR: + $message = 'Missing a temporary folder'; + break; + case UPLOAD_ERR_CANT_WRITE: + $message = 'Failed to write file to disk'; + break; + case UPLOAD_ERR_EXTENSION: + $message = 'File upload stopped by extension'; + break; + + default: + $message = 'Unknown upload error'; + break; + } + + return $message; + } +} -- cgit v1.2.3