Nullable+void typehint

This commit is contained in:
Dennis Eichhorn 2018-03-13 20:55:24 +01:00
parent 915bd91d7b
commit c6757cb385
4 changed files with 17 additions and 17 deletions

View File

@ -36,7 +36,7 @@ class Navigation
* *
* @since 1.0.0 * @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); $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);

View File

@ -282,7 +282,7 @@ class Controller extends ModuleAbstract implements WebInterface
* *
* @since 1.0.0 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) 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 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) 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 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) 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 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::BADGE) 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 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::DELETE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::ARTICLE) 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 * @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( if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
PermissionType::DELETE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::BADGE) PermissionType::DELETE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::BADGE)

View File

@ -38,7 +38,7 @@ class Badge
return $this->id; return $this->id;
} }
public function setName(string $name) /* : void */ public function setName(string $name) : void
{ {
$this->name = $name; $this->name = $name;
} }

View File

@ -157,7 +157,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function addBadge(Badge $badge) /* : void */ public function addBadge(Badge $badge) : void
{ {
$this->badges[] = $badge; $this->badges[] = $badge;
} }
@ -183,7 +183,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setContent(string $content) /* : void */ public function setContent(string $content) : void
{ {
$this->content = $content; $this->content = $content;
} }
@ -271,7 +271,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setLanguage(string $language) /* : void */ public function setLanguage(string $language) : void
{ {
if (!ISO639x1Enum::isValidValue($language)) { if (!ISO639x1Enum::isValidValue($language)) {
throw new InvalidEnumValue($language); throw new InvalidEnumValue($language);
@ -289,7 +289,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setPublish(\DateTime $publish) /* : void */ public function setPublish(\DateTime $publish) : void
{ {
$this->publish = $publish; $this->publish = $publish;
} }
@ -315,7 +315,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setCreatedBy($id) /* : void */ public function setCreatedBy($id) : void
{ {
$this->createdBy = $id; $this->createdBy = $id;
} }
@ -339,7 +339,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setTitle(string $title) /* : void */ public function setTitle(string $title) : void
{ {
$this->title = $title; $this->title = $title;
} }
@ -365,7 +365,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setType(int $type) /* : void */ public function setType(int $type) : void
{ {
if (!NewsType::isValidValue($type)) { if (!NewsType::isValidValue($type)) {
throw new InvalidEnumValue((string) $type); throw new InvalidEnumValue((string) $type);
@ -395,7 +395,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setStatus(int $status) /* : void */ public function setStatus(int $status) : void
{ {
if (!NewsStatus::isValidValue($status)) { if (!NewsStatus::isValidValue($status)) {
throw new InvalidEnumValue((string) $status); throw new InvalidEnumValue((string) $status);
@ -423,7 +423,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setFeatured(bool $featured) /* : void */ public function setFeatured(bool $featured) : void
{ {
$this->featured = $featured; $this->featured = $featured;
} }