From ded124082d6d5ed04e24220199a79d1d00ac5ef0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 21 Apr 2022 23:52:00 +0200 Subject: [PATCH] doc fixes --- Admin/Installer.php | 10 ++++++---- CONTRIBUTING.md | 2 +- Controller/ApiController.php | 16 ++++++++-------- Controller/BackendController.php | 14 +++++++------- Models/MediaMapper.php | 2 +- .../Components/InlinePreview/BaseView.php | 2 ++ Theme/Backend/Components/Upload/BaseView.php | 1 + 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index a290c58..ca899d1 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -65,6 +65,7 @@ final class Installer extends InstallerAbstract // However, the admin account is created before the Media module is installed // Because of this, the directory needs to be created manually after the Media installation // The admin account should be the only DB account, but we use a loop of all accounts to avoid bugs + /** @var \Modules\Admin\Models\Account[] $accounts */ $accounts = AccountMapper::getAll()->execute(); foreach ($accounts as $account) { @@ -153,10 +154,10 @@ final class Installer extends InstallerAbstract /** * Create collection. * - * @param ApplicationAbstract $app Application - * @param array $data Media info + * @param ApplicationAbstract $app Application + * @param array{path?:string, name?:string, virtualPath?:string, create_directory?:bool} $data Media info * - * @return Collection + * @return array * * @since 1.0.0 */ @@ -193,7 +194,7 @@ final class Installer extends InstallerAbstract * @param ApplicationAbstract $app Application * @param array $data Media info * - * @return MediaType + * @return array * * @since 1.0.0 */ @@ -282,6 +283,7 @@ final class Installer extends InstallerAbstract \RecursiveIteratorIterator::SELF_FIRST ); + /** @var \DirectoryIterator $iterator */ foreach ($iterator as $item) { if ($item->isDir()) { continue; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9b4371..4bbb819 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Generally, the development philosophy is result orientated. This means that anyo Developers are encouraged to pick open tasks with high priorities according to their own skill level. Senior developers may directly assign tasks to developers based on their importance. New developers may find it easier to start with a task that has a low priority as they often also have a lower difficulty. -Open tasks can be found in the project overview: [PROJECT.md](../Project/PROJECT.md) +Open tasks can be found in the project overview: [PROJECT.md](https://github.com/Karaka-Management/Organization-Guide/blob/master/Project/PROJECT.md) Tasks currently in development are prefixed in the priority column with an asterisk `*` and a name tag in the task description of the developer who is working on the task. diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 17b0dd9..a18ae96 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -77,7 +77,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaUpload(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaUpload(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { $uploads = $this->uploadFiles( names: $request->getDataList('names'), @@ -385,10 +385,10 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaUpdate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { /** @var Media $old */ - $old = clone MediaMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $old = MediaMapper::get()->where('id', (int) $request->getData('id'))->execute(); /** @var Media $new */ $new = $this->updateMediaFromRequest($request); @@ -457,7 +457,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiCollectionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiCollectionCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateCollectionCreate($request))) { $response->set('collection_create', new FormValidation($val)); @@ -648,7 +648,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { $path = \urldecode((string) ($request->getData('path') ?? '')); $virtualPath = \urldecode((string) ($request->getData('virtualpath') ?? '/')); @@ -723,7 +723,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaExport(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaExport(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (((int) $request->getData('id')) !== 0) { /** @var Media $media */ @@ -916,7 +916,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaTypeCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaTypeCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateMediaTypeCreate($request))) { $response->set('media_type_create', new FormValidation($val)); @@ -986,7 +986,7 @@ final class ApiController extends Controller * * @since 1.0.0 */ - public function apiMediaTypeL11nCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function apiMediaTypeL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { if (!empty($val = $this->validateMediaTypeL11nCreate($request))) { $response->set('media_type_l11n_create', new FormValidation($val)); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index fbe6474..451acad 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -71,7 +71,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Media/Theme/Backend/media-list'); @@ -204,7 +204,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaSingle(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaSingle(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new MediaView($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Media/Theme/Backend/media-single'); @@ -355,7 +355,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewModuleSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewModuleSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response)); @@ -391,7 +391,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaTypeSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaTypeSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings-type'); @@ -419,7 +419,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaUpload(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaUpload(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Media/Theme/Backend/media-upload'); @@ -439,7 +439,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaFileCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaFileCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Media/Theme/Backend/media-file-create'); @@ -462,7 +462,7 @@ final class BackendController extends Controller * @since 1.0.0 * @codeCoverageIgnore */ - public function viewMediaCollectionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewMediaCollectionCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Media/Theme/Backend/media-collection-create'); diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index 2f89487..272ff89 100755 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -60,7 +60,7 @@ class MediaMapper extends DataMapperFactory /** * Belongs to. * - * @var array + * @var array * @since 1.0.0 */ public const BELONGS_TO = [ diff --git a/Theme/Backend/Components/InlinePreview/BaseView.php b/Theme/Backend/Components/InlinePreview/BaseView.php index 5d9e4ea..811f117 100755 --- a/Theme/Backend/Components/InlinePreview/BaseView.php +++ b/Theme/Backend/Components/InlinePreview/BaseView.php @@ -84,11 +84,13 @@ class BaseView extends View */ public function render(...$data) : string { + /** @var array{0:string, 1:string, 2:string, 3?:string, 4?:bool} $data */ $this->form = $data[0]; $this->id = $data[1]; $this->name = $data[2]; $this->virtualPath = $data[3] ?? '/'; $this->isRequired = $data[4] ?? false; + return parent::render(); } diff --git a/Theme/Backend/Components/Upload/BaseView.php b/Theme/Backend/Components/Upload/BaseView.php index 1e742eb..508d222 100755 --- a/Theme/Backend/Components/Upload/BaseView.php +++ b/Theme/Backend/Components/Upload/BaseView.php @@ -68,6 +68,7 @@ class BaseView extends View */ public function render(...$data) : string { + /** @var array{0:string, 1?:string, 2?:string} $data */ $this->form = $data[0]; $this->name = $data[1] ?? 'UNDEFINED'; $this->virtualPath = $data[2] ?? '';