PHP Classes

Please clean up your code, the styling needs to be fixed as w...

Recommend this page to a friend!

      PHP Base64 Encode File  >  All threads  >  Please clean up your code, the...  >  (Un) Subscribe thread alerts  
Subject:Please clean up your code, the...
Summary:Package rating comment
Messages:1
Author:Andrew Hong
Date:2018-10-31 13:56:14
 

Andrew Hong rated this package as follows:

Utility: Sufficient
Consistency: Insufficient

  1. Please clean up your code, the...   Reply   Report abuse  
Picture of Andrew Hong Andrew Hong - 2018-10-31 13:56:14
Please clean up your code, the styling needs to be fixed as well as the following:

if(in_array($this->ext,array("jpg","gif","png","bmp","jpeg"))){
$type="image/$this->ext";
}

You can modify this to simply be: $this->type = mime_content_type($this->filename);

See the following:
php.net/manual/en/function.mime-con ...

Additionally, in terms of your variables, it seems that you switch between $this->variable and $variable, which while will work in your class, you may run in to issues in larger classes/projects.

Good start, though!