mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-02-10 15:28:41 +00:00
static code analysis fixes
This commit is contained in:
parent
ec07a3b28d
commit
802aea162d
|
|
@ -79,8 +79,8 @@ final class ApiController extends Controller
|
||||||
$doc = $this->createWikiDocFromRequest($request, $response, $data);
|
$doc = $this->createWikiDocFromRequest($request, $response, $data);
|
||||||
$this->createModel($request->header->account, $doc, WikiDocMapper::class, 'doc', $request->getOrigin());
|
$this->createModel($request->header->account, $doc, WikiDocMapper::class, 'doc', $request->getOrigin());
|
||||||
|
|
||||||
if (!empty($request->getFiles() ?? [])
|
if (!empty($request->getFiles())
|
||||||
|| !empty($request->getDataJson('media') ?? [])
|
|| !empty($request->getDataJson('media'))
|
||||||
) {
|
) {
|
||||||
$this->createWikiMedia($doc, $request);
|
$this->createWikiMedia($doc, $request);
|
||||||
}
|
}
|
||||||
|
|
@ -108,7 +108,7 @@ final class ApiController extends Controller
|
||||||
$path = $this->createWikiDir($doc);
|
$path = $this->createWikiDir($doc);
|
||||||
$account = AccountMapper::get()->where('id', $request->header->account)->execute();
|
$account = AccountMapper::get()->where('id', $request->header->account)->execute();
|
||||||
|
|
||||||
if (!empty($uploadedFiles = $request->getFiles() ?? [])) {
|
if (!empty($uploadedFiles = $request->getFiles())) {
|
||||||
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
|
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
|
|
@ -146,7 +146,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($mediaFiles = $request->getDataJson('media') ?? [])) {
|
if (!empty($mediaFiles = $request->getDataJson('media'))) {
|
||||||
$collection = null;
|
$collection = null;
|
||||||
|
|
||||||
foreach ($mediaFiles as $media) {
|
foreach ($mediaFiles as $media) {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ final class WikiCategoryMapper extends DataMapperFactory
|
||||||
/**
|
/**
|
||||||
* Has owns one relation.
|
* Has owns one relation.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, null|string>>
|
* @var array<string, array{mapper:string, external:string}>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const BELONGS_TO = [
|
public const BELONGS_TO = [
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ final class WikiDocMapper extends DataMapperFactory
|
||||||
/**
|
/**
|
||||||
* Has owns one relation.
|
* Has owns one relation.
|
||||||
*
|
*
|
||||||
* @var array<string, array<string, null|string>>
|
* @var array<string, array{mapper:string, external:string}>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const BELONGS_TO = [
|
public const BELONGS_TO = [
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"friendsofphp/php-cs-fixer": ">=3.2",
|
"friendsofphp/php-cs-fixer": ">=3.2",
|
||||||
"squizlabs/php_codesniffer": ">=3.6",
|
"squizlabs/php_codesniffer": ">=3.6",
|
||||||
"phpmd/phpmd": ">=2.9",
|
"phpmd/phpmd": ">=2.9",
|
||||||
"phpstan/phpstan": ">=0.12.58",
|
"phpstan/phpstan": ">=1.5.4",
|
||||||
"phan/phan": ">=3.2.6"
|
"phan/phan": ">=3.2.6"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user