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/UploadedFile.class.php | 44 ++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'static/classes/UploadedFile.class.php') diff --git a/static/classes/UploadedFile.class.php b/static/classes/UploadedFile.class.php index 1cf8914..5e8ae1c 100644 --- a/static/classes/UploadedFile.class.php +++ b/static/classes/UploadedFile.class.php @@ -1,27 +1,29 @@ sha1) - $this->sha1 = sha1_file($this->tempfile); + /** + * Generates the SHA1 or returns the cached SHA1 hash for the file. + * + * @return string + */ + public function get_sha1() + { + if (!$this->sha1) { + $this->sha1 = sha1_file($this->tempfile); + } - return $this->sha1; - } + return $this->sha1; + } } -?> -- cgit v1.2.3