| @@ -1,36 +1,98 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -declare(strict_types=1); | |
| 4 | - | |
| 2 | +/** | |
| 3 | + * FileObject.php | |
| 4 | + * | |
| 5 | + * The FileObject class file. | |
| 6 | + * | |
| 7 | + * PHP versions 5 | |
| 8 | + * | |
| 9 | + * @author Alexander Schneider <[email protected]> | |
| 10 | + * @copyright 2008-2017 Alexander Schneider | |
| 11 | + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 | |
| 12 | + * @version SVN: $id$ | |
| 13 | + * @link http://wordpress.org/extend/plugins/user-access-manager/ | |
| 14 | + */ | |
| 5 | 15 | namespace UserAccessManager\File; |
| 6 | 16 | |
| 17 | +/** | |
| 18 | + * Class FileObject | |
| 19 | + * @package UserAccessManager\FileHandler | |
| 20 | + */ | |
| 7 | 21 | class FileObject |
| 8 | 22 | { |
| 9 | - public function __construct( | |
| 10 | - private int|string $id, | |
| 11 | - private string $type, | |
| 12 | - private string $file, | |
| 13 | - private bool $isImage = false | |
| 14 | - ) { | |
| 23 | + /** | |
| 24 | + * @var string | |
| 25 | + */ | |
| 26 | + private $id; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * @var string | |
| 30 | + */ | |
| 31 | + private $type; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * @var string | |
| 35 | + */ | |
| 36 | + private $file; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * @var bool | |
| 40 | + */ | |
| 41 | + private $isImage; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * FileObject constructor. | |
| 45 | + * | |
| 46 | + * @param string $id | |
| 47 | + * @param string $type | |
| 48 | + * @param string $file | |
| 49 | + * @param bool $isImage | |
| 50 | + */ | |
| 51 | + public function __construct($id, $type, $file, $isImage = false) | |
| 52 | + { | |
| 53 | + $this->id = $id; | |
| 54 | + $this->type = $type; | |
| 55 | + $this->file = $file; | |
| 56 | + $this->isImage = $isImage; | |
| 15 | 57 | } |
| 16 | 58 | |
| 17 | - public function getId(): int|string | |
| 59 | + /** | |
| 60 | + * Returns the file object id. | |
| 61 | + * | |
| 62 | + * @return string | |
| 63 | + */ | |
| 64 | + public function getId() | |
| 18 | 65 | { |
| 19 | 66 | return $this->id; |
| 20 | 67 | } |
| 21 | 68 | |
| 22 | - public function getType(): string | |
| 69 | + /** | |
| 70 | + * Returns the file object type. | |
| 71 | + * | |
| 72 | + * @return string | |
| 73 | + */ | |
| 74 | + public function getType() | |
| 23 | 75 | { |
| 24 | 76 | return $this->type; |
| 25 | 77 | } |
| 26 | 78 | |
| 27 | - public function getFile(): string | |
| 79 | + /** | |
| 80 | + * Returns the file object file. | |
| 81 | + * | |
| 82 | + * @return string | |
| 83 | + */ | |
| 84 | + public function getFile() | |
| 28 | 85 | { |
| 29 | 86 | return $this->file; |
| 30 | 87 | } |
| 31 | 88 | |
| 32 | - public function isImage(): bool | |
| 89 | + /** | |
| 90 | + * Returns true if the file is a image. | |
| 91 | + * | |
| 92 | + * @return bool | |
| 93 | + */ | |
| 94 | + public function isImage() | |
| 33 | 95 | { |
| 34 | 96 | return $this->isImage; |
| 35 | 97 | } |
| 36 | 98 | } |