mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-14 23:58:39 +00:00
Nullable+void typehint
This commit is contained in:
parent
915bd91d7b
commit
c6757cb385
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class Badge
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
public function setName(string $name) /* : void */
|
||||
public function setName(string $name) : void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user