From c6757cb38524468945d6886208158808e8f5e214 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 13 Mar 2018 20:55:24 +0100 Subject: [PATCH] Nullable+void typehint --- Admin/Install/Navigation.php | 2 +- Controller.php | 12 ++++++------ Models/Badge.php | 2 +- Models/NewsArticle.php | 18 +++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 8fb385d..b0b2aea 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -36,7 +36,7 @@ class Navigation * * @since 1.0.0 */ - public static function install(string $path = null, DatabasePool $dbPool = null) /* : void */ + public static function install(string $path = null, DatabasePool $dbPool = null) : void { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Controller.php b/Controller.php index 6a71457..769bff3 100644 --- a/Controller.php +++ b/Controller.php @@ -282,7 +282,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiNewsUpdate(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiNewsUpdate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) @@ -338,7 +338,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiNewsCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiNewsCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) @@ -396,7 +396,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiNewsGet(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiNewsGet(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) @@ -446,7 +446,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiBadgeCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiBadgeCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::BADGE) @@ -548,7 +548,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiNewsDelete(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiNewsDelete(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::DELETE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) @@ -580,7 +580,7 @@ class Controller extends ModuleAbstract implements WebInterface * * @since 1.0.0 */ - public function apiDeleteNewsBadge(RequestAbstract $request, ResponseAbstract $response, $data = null) /* : void */ + public function apiDeleteNewsBadge(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission( PermissionType::DELETE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::BADGE) diff --git a/Models/Badge.php b/Models/Badge.php index cdbb7b3..8720cf7 100644 --- a/Models/Badge.php +++ b/Models/Badge.php @@ -38,7 +38,7 @@ class Badge return $this->id; } - public function setName(string $name) /* : void */ + public function setName(string $name) : void { $this->name = $name; } diff --git a/Models/NewsArticle.php b/Models/NewsArticle.php index 16fd1ad..e6259df 100644 --- a/Models/NewsArticle.php +++ b/Models/NewsArticle.php @@ -157,7 +157,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function addBadge(Badge $badge) /* : void */ + public function addBadge(Badge $badge) : void { $this->badges[] = $badge; } @@ -183,7 +183,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setContent(string $content) /* : void */ + public function setContent(string $content) : void { $this->content = $content; } @@ -271,7 +271,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setLanguage(string $language) /* : void */ + public function setLanguage(string $language) : void { if (!ISO639x1Enum::isValidValue($language)) { throw new InvalidEnumValue($language); @@ -289,7 +289,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setPublish(\DateTime $publish) /* : void */ + public function setPublish(\DateTime $publish) : void { $this->publish = $publish; } @@ -315,7 +315,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setCreatedBy($id) /* : void */ + public function setCreatedBy($id) : void { $this->createdBy = $id; } @@ -339,7 +339,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setTitle(string $title) /* : void */ + public function setTitle(string $title) : void { $this->title = $title; } @@ -365,7 +365,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setType(int $type) /* : void */ + public function setType(int $type) : void { if (!NewsType::isValidValue($type)) { throw new InvalidEnumValue((string) $type); @@ -395,7 +395,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setStatus(int $status) /* : void */ + public function setStatus(int $status) : void { if (!NewsStatus::isValidValue($status)) { throw new InvalidEnumValue((string) $status); @@ -423,7 +423,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function setFeatured(bool $featured) /* : void */ + public function setFeatured(bool $featured) : void { $this->featured = $featured; }