mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-01-24 07:18:40 +00:00
phpstan fixes
This commit is contained in:
parent
e0dbea336c
commit
a1b0f6ad60
|
|
@ -48,7 +48,7 @@ final class Installer extends InstallerAbstract
|
|||
$id = WikiAppMapper::create($app);
|
||||
|
||||
$category = new WikiCategory();
|
||||
$category->setApp(new NullWikiApp($id));
|
||||
$category->app = new NullWikiApp($id);
|
||||
$category->setName('Default');
|
||||
|
||||
WikiCategoryMapper::create($category);
|
||||
|
|
@ -62,7 +62,7 @@ final class Installer extends InstallerAbstract
|
|||
$id = WikiAppMapper::create($app);
|
||||
|
||||
$category = new WikiCategory();
|
||||
$category->setApp(new NullWikiApp($id));
|
||||
$category->app = new NullWikiApp($id);
|
||||
$category->setName('Default');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,10 +89,10 @@ final class ApiController extends Controller
|
|||
$doc->name = (string) $request->getData('title');
|
||||
$doc->doc = Markdown::parse((string) ($request->getData('plain') ?? ''));
|
||||
$doc->docRaw = (string) ($request->getData('plain') ?? '');
|
||||
$doc->setCategory(new NullWikiCategory((int) ($request->getData('category') ?? 1)));
|
||||
$doc->category = new NullWikiCategory((int) ($request->getData('category') ?? 1));
|
||||
$doc->setLanguage((string) ($request->getData('language') ?? $request->getLanguage()));
|
||||
$doc->setStatus((int) ($request->getData('status') ?? WikiStatus::INACTIVE));
|
||||
$doc->setApp(new NullWikiApp((int) ($request->getData('app') ?? 1)));
|
||||
$doc->app = new NullWikiApp((int) ($request->getData('app') ?? 1));
|
||||
|
||||
if (!empty($tags = $request->getDataJson('tags'))) {
|
||||
foreach ($tags as $tag) {
|
||||
|
|
@ -335,7 +335,7 @@ final class ApiController extends Controller
|
|||
public function createWikiCategoryFromRequest(RequestAbstract $request) : WikiCategory
|
||||
{
|
||||
$category = new WikiCategory();
|
||||
$category->setApp(new NullWikiApp((int) ($request->getData('app') ?? 1)));
|
||||
$category->app = new NullWikiApp((int) ($request->getData('app') ?? 1));
|
||||
|
||||
if ($request->getData('parent') !== null) {
|
||||
$category->parent = new NullWikiCategory((int) $request->getData('parent'));
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class WikiCategory implements \JsonSerializable
|
|||
* @var WikiApp
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private WikiApp $app;
|
||||
public WikiApp $app;
|
||||
|
||||
/**
|
||||
* Name.
|
||||
|
|
@ -91,32 +91,6 @@ class WikiCategory implements \JsonSerializable
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get app
|
||||
*
|
||||
* @return WikiApp
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getApp() : WikiApp
|
||||
{
|
||||
return $this->app ?? new NullWikiApp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set app
|
||||
*
|
||||
* @param null|WikiApp $app App
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setApp(?WikiApp $app) : void
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
|
|
@ -132,7 +106,7 @@ class WikiCategory implements \JsonSerializable
|
|||
/**
|
||||
* Set name
|
||||
*
|
||||
* @param string|TagL11n $name Tag article name
|
||||
* @param string|WikiCategoryL11n $name Tag article name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class WikiDoc implements \JsonSerializable
|
|||
* @var null|WikiApp
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private ?WikiApp $app = null;
|
||||
public ?WikiApp $app = null;
|
||||
|
||||
/**
|
||||
* Name.
|
||||
|
|
@ -82,7 +82,7 @@ class WikiDoc implements \JsonSerializable
|
|||
* @var null|WikiCategory
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private ?WikiCategory $category = null;
|
||||
public ?WikiCategory $category = null;
|
||||
|
||||
/**
|
||||
* Language.
|
||||
|
|
@ -112,32 +112,6 @@ class WikiDoc implements \JsonSerializable
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get app
|
||||
*
|
||||
* @return WikiApp
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getApp() : WikiApp
|
||||
{
|
||||
return $this->app ?? new NullWikiApp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set app
|
||||
*
|
||||
* @param null|WikiApp $app App
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setApp(?WikiApp $app) : void
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language
|
||||
*
|
||||
|
|
@ -190,32 +164,6 @@ class WikiDoc implements \JsonSerializable
|
|||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category
|
||||
*
|
||||
* @return WikiCategory
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCategory() : WikiCategory
|
||||
{
|
||||
return $this->category ?? new NullWikiCategory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cateogry
|
||||
*
|
||||
* @param null|WikiCategory $category Category
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setCategory(?WikiCategory $category) : void
|
||||
{
|
||||
$this->category = $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user