From 819734dacaac1ab32a3ec1d4668e88fa6a5dc5b1 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 25 May 2023 07:48:47 +0000 Subject: [PATCH] Auto docblock fixes. --- Controller/FileUploaderTrait.php | 32 +++++++++++++-------------- Models/MediaClass.php | 2 +- Models/MediaContent.php | 16 +++++--------- Models/MediaStatus.php | 2 +- Models/NullCollection.php | 2 +- Models/NullMedia.php | 38 ++++++++++++++++---------------- Models/NullMediaContent.php | 33 +++++++++++++-------------- Models/NullMediaType.php | 2 +- Models/Reference.php | 30 +++++++++++++------------ Models/ReferenceMapper.php | 0 Models/UploadStatus.php | 0 11 files changed, 78 insertions(+), 79 deletions(-) mode change 100755 => 100644 Controller/FileUploaderTrait.php mode change 100755 => 100644 Models/MediaClass.php mode change 100755 => 100644 Models/MediaContent.php mode change 100755 => 100644 Models/MediaStatus.php mode change 100755 => 100644 Models/NullCollection.php mode change 100755 => 100644 Models/NullMedia.php mode change 100755 => 100644 Models/NullMediaContent.php mode change 100755 => 100644 Models/NullMediaType.php mode change 100755 => 100644 Models/Reference.php mode change 100755 => 100644 Models/ReferenceMapper.php mode change 100755 => 100644 Models/UploadStatus.php diff --git a/Controller/FileUploaderTrait.php b/Controller/FileUploaderTrait.php old mode 100755 new mode 100644 index 319ba49..a1968f9 --- a/Controller/FileUploaderTrait.php +++ b/Controller/FileUploaderTrait.php @@ -19,7 +19,7 @@ use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; /** - * Options trait. + * Trait for setting up file upload functionality. * * @package Modules\Media\Controller * @license OMS License 2.0 @@ -28,21 +28,21 @@ use phpOMS\Message\ResponseAbstract; */ trait FileUploaderTrait { - /** + /** * Setup file uploader. - * - * @param RequestAbstract $request Request - * @param ResponseAbstract $response Response - * @param mixed $data Misc. data - * - * @return void - * - * @since 1.0.0 + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Misc. data + * + * @return void + * + * @since 1.0.0 * @codeCoverageIgnore - */ - public static function setUpFileUploaderTrait(RequestAbstract $request, ResponseAbstract $response, $data = null) : void - { - $head = $response->get('Content')->getData('head'); - $head->addAsset(AssetType::JS, '/Modules/Media/Controller.js', ['type' => 'module']); - } + */ + public static function setUpFileUploaderTrait(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + { + $head = $response->get('Content')->getData('head'); + $head->addAsset(AssetType::JS, '/Modules/Media/Controller.js', ['type' => 'module']); + } } diff --git a/Models/MediaClass.php b/Models/MediaClass.php old mode 100755 new mode 100644 index bedf42f..3ec34d6 --- a/Models/MediaClass.php +++ b/Models/MediaClass.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * Represents the type/class of media in the application. * * @package Modules\Media\Models * @license OMS License 2.0 diff --git a/Models/MediaContent.php b/Models/MediaContent.php old mode 100755 new mode 100644 index f945d32..93b1d42 --- a/Models/MediaContent.php +++ b/Models/MediaContent.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * Media content class. * * @package Modules\Media\Models * @license OMS License 2.0 @@ -32,17 +32,13 @@ class MediaContent implements \JsonSerializable */ public int $id = 0; - public string $content = ''; - /** - * @return int + * Content of the media. * + * @var string * @since 1.0.0 */ - public function getId() : int - { - return $this->id; - } + public string $content = ''; /** * {@inheritdoc} @@ -50,8 +46,8 @@ class MediaContent implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'content' => $this->content, + 'id' => $this->id, + 'content' => $this->content, ]; } diff --git a/Models/MediaStatus.php b/Models/MediaStatus.php old mode 100755 new mode 100644 index 0ba9c1b..c2ca7cd --- a/Models/MediaStatus.php +++ b/Models/MediaStatus.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * Media status enum. * * @package Modules\Media\Models * @license OMS License 2.0 diff --git a/Models/NullCollection.php b/Models/NullCollection.php old mode 100755 new mode 100644 index 81e9744..5f25311 --- a/Models/NullCollection.php +++ b/Models/NullCollection.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * NullCollection class. * * @package Modules\Media\Models * @license OMS License 2.0 diff --git a/Models/NullMedia.php b/Models/NullMedia.php old mode 100755 new mode 100644 index 5d7ff87..ee112d7 --- a/Models/NullMedia.php +++ b/Models/NullMedia.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * NullMedia class represents a null object of the Media class. * * @package Modules\Media\Models * @license OMS License 2.0 @@ -24,24 +24,24 @@ namespace Modules\Media\Models; */ final class NullMedia extends Media { - /** - * Constructor - * - * @param int $id Model id - * - * @since 1.0.0 - */ - public function __construct(int $id = 0) - { - $this->id = $id; - parent::__construct(); - } + /** + * Constructor. + * + * @param int $id Model id + * + * @since 1.0.0 + */ + public function __construct(int $id = 0) + { + $this->id = $id; + parent::__construct(); + } - /** - * {@inheritdoc} - */ + /** + * {@inheritdoc} + */ public function jsonSerialize() : mixed - { - return ['id' => $this->id]; - } + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMediaContent.php b/Models/NullMediaContent.php old mode 100755 new mode 100644 index 8a6beae..2ab7231 --- a/Models/NullMediaContent.php +++ b/Models/NullMediaContent.php @@ -15,7 +15,8 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media class. + * Class NullMediaContent + * Represents null media content. * * @package Modules\Media\Models * @license OMS License 2.0 @@ -24,23 +25,23 @@ namespace Modules\Media\Models; */ final class NullMediaContent extends MediaContent { - /** + /** * Constructor - * + * * @param int $id Model id - * - * @since 1.0.0 - */ - public function __construct(int $id = 0) - { - $this->id = $id; - } + * + * @since 1.0.0 + */ + public function __construct(int $id = 0) + { + $this->id = $id; + } - /** + /** * {@inheritdoc} - */ - public function jsonSerialize() : mixed - { - return ['id' => $this->id]; - } + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMediaType.php b/Models/NullMediaType.php old mode 100755 new mode 100644 index 16594e3..e0c949c --- a/Models/NullMediaType.php +++ b/Models/NullMediaType.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Modules\Media\Models; /** - * Media type class. + * Null media type class. * * @package Modules\Media\Models * @license OMS License 2.0 diff --git a/Models/Reference.php b/Models/Reference.php old mode 100755 new mode 100644 index f669027..1572d3a --- a/Models/Reference.php +++ b/Models/Reference.php @@ -17,6 +17,8 @@ namespace Modules\Media\Models; /** * Reference class. * + * This class represents a reference to a media file. It extends the Media class. + * * @package Modules\Media\Models * @license OMS License 2.0 * @link https://jingga.app @@ -24,19 +26,19 @@ namespace Modules\Media\Models; */ class Reference extends Media { - /** - * Extension name. - * - * @var string - * @since 1.0.0 - */ - public string $extension = 'reference'; + /** + * The file extension of the reference file. + * + * @var string + * @since 1.0.0 + */ + public string $extension = 'reference'; - /** - * Is reference. - * - * @var int - * @since 1.0.0 - */ - public int $class = MediaClass::REFERENCE; + /** + * The media class of the reference. + * + * @var int + * @since 1.0.0 + */ + public int $class = MediaClass::REFERENCE; } diff --git a/Models/ReferenceMapper.php b/Models/ReferenceMapper.php old mode 100755 new mode 100644 diff --git a/Models/UploadStatus.php b/Models/UploadStatus.php old mode 100755 new mode 100644