maximum) and $file['size'] > $this->maximum) { return false; } if ( ! is_null($this->extensions) and ! in_array(File::extension($file['name']), $this->extensions)) { return false; } return true; } /** * Set the acceptable file extensions. * * @return Upload_Of */ public function has_extension() { $this->extensions = func_get_args(); return $this; } /** * Set the maximum file size in bytes. * * @param int $maximum * @return Upload_Of */ public function less_than($maximum) { $this->maximum = $maximum; return $this; } }