/**
* UploadField constructor.
*
- * @param String $fieldId
- * @param String $fieldName
- * @param String $fieldDescription
+ * @param string $fieldId
+ * @param string $fieldName
+ * @param string $fieldDescription
*/
public function __construct($fieldId, $fieldName = 'Upload', $fieldDescription = null) {
$this->fieldId = $fieldId;
/**
* Returns the fieldId.
*
- * @return String
+ * @return string
*/
public function getFieldId() {
return $this->fieldId;
/**
* Sets the internalId for this field.
*
- * @param String $internalId
+ * @param string $internalId
*/
public function setInternalId($internalId) {
$this->internalId = $internalId;
/**
* Returns the internalId of this field.
*
- * @return String|null
+ * @return string|null
*/
public function getInternalId() {
return $this->internalId;
/**
* Returns the name of the field.
*
- * @return String
+ * @return string
*/
public function getName() {
return WCF::getLanguage()->get($this->name);
/**
* Returns the description of the field.
*
- * @return String
+ * @return string
*/
public function getDescription() {
return WCF::getLanguage()->get($this->description);
class UploadFile {
/**
* Location for the file.
- * @var String
+ * @var string
*/
private $location;
/**
* The filename.
- * @var String
+ * @var string
*/
private $filename;
/**
* The unique id for the file.
- * @var String
+ * @var string
*/
private $uniqueId;
/**
* UploadFile constructor.
*
- * @param String $location
- * @param String $filename
+ * @param string $location
+ * @param string $filename
* @param boolean $viewableImage
* @param boolean $processed
*/
* Returns the image location or a base64 encoded string of the image. Returns null
* if the file is not an image or the image is not viewable.
*
- * @return String|null
+ * @return string|null
*/
public function getImage() {
if (!$this->isImage() || !$this->viewableImage) {
/**
* Returns the location of the file.
*
- * @return String
+ * @return string
*/
public function getLocation() {
return $this->location;
/**
* Returns the filename of the file.
*
- * @return String
+ * @return string
*/
public function getFilename() {
return $this->filename;
/**
* Returns the unique file id for the file. It is used to identify the certain file.
- * @return String
+ * @return string
*/
public function getUniqueFileId() {
return $this->uniqueId;
* Sets the new location of the file, after it is processed and
* sets the `processed` attribute to true.
*
- * @param String $newLocation
+ * @param string $newLocation
*/
public function setProcessed($newLocation) {
if (!file_exists($newLocation)) {
/**
* Returns the uploaded files for a specific fieldId.
*
- * @param String $fieldId
+ * @param string $fieldId
* @return UploadFile[]
*/
public function getFilesForFieldId($fieldId) {
/**
* Returns the removed but previosly proccessed files for a specific fieldId.
*
- * @param String $fieldId
+ * @param string $fieldId
* @param boolean $processFiles
* @return UploadFile[]
*/
/**
* Returns the removed but previosly proccessed files for a specific internalId.
*
- * @param String $internalId
+ * @param string $internalId
* @param boolean $processFiles
* @return UploadFile[]
*/
/**
* Renders the field with the given fieldId for the template.
- * @param String $fieldId
- * @return String
+ * @param string $fieldId
+ * @return string
*/
public function renderField($fieldId) {
if (!isset($this->fields[$fieldId])) {
/**
* Returns true, if the given internalId is valid.
*
- * @param String $internalId
+ * @param string $internalId
* @return boolean
*/
public function isValidInternalId($internalId) {
/**
*
- * @param String $internalId
- * @param String $uniqueFileId
+ * @param string $internalId
+ * @param string $uniqueFileId
* @return boolean
*/
public function isValidUniqueFileId($internalId, $uniqueFileId) {
/**
*
- * @param String $internalId
- * @param String $uniqueFileId
+ * @param string $internalId
+ * @param string $uniqueFileId
* @return UploadFile|null
*/
public function getFileForUniqueFileId($internalId, $uniqueFileId) {
/**
* Add a file for an internalId.
*
- * @param String $internalId
+ * @param string $internalId
* @param UploadFile $file
*/
public function addFileForInternalId($internalId, UploadFile $file) {
* HEADS UP: Deletes all uploaded files and overwrites them with
* the given files. If you want to add a file, use the addFileForInternalId method.
*
- * @param String $internalId
+ * @param string $internalId
* @param UploadFile[] $files
*/
public function registerFilesForInternalId($internalId, array $files) {
/**
* Add a file for an upload field with the given fieldId.
*
- * @param String $fieldId
+ * @param string $fieldId
* @param UploadFile $file
*/
public function addFileForField($fieldId, UploadFile $file) {
* HEADS UP: Deletes all uploaded files and overwrites them with
* the given files. If you want to add a file, use the addFileForField method.
*
- * @param String $fieldId
+ * @param string $fieldId
* @param UploadFile[] $files
*/
public function registerFilesForField($fieldId, array $files) {
/**
* Returns the field for the internalId.
*
- * @param String $internalId
+ * @param string $internalId
* @return UploadField
*/
public function getFieldForInternalId($internalId) {
/**
* Returns the count of uploaded files for an internal id.
*
- * @param String $internalId
+ * @param string $internalId
* @return int
*/
public function getFilesCountForInternalId($internalId) {
/**
* Returns the files for an internal identifier.
*
- * @param String $internalId
+ * @param string $internalId
* @return UploadFile[]
*/
private function getFilesForInternalId($internalId) {
/**
* Returns the known internalIds.
*
- * @return String[]
+ * @return string[]
*/
private function getKnownInternalIds() {
return array_keys($this->getStorage());