mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-08 04:18:41 +00:00
fix phpstan lvl 9 bugs
This commit is contained in:
parent
693400e2fd
commit
ce530f6d9b
|
|
@ -184,7 +184,9 @@ final class ApiController extends Controller
|
|||
$unit = $this->createUnitFromRequest($request);
|
||||
$this->createModel($request->header->account, $unit, UnitMapper::class, 'unit', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT)->content === '1') {
|
||||
/** @var \Model\Setting $setting */
|
||||
$setting = $this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_UNIT);
|
||||
if ($setting->content === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->header->account = $request->header->account;
|
||||
$newRequest->setData('name', 'org:unit:' . \strtolower($unit->name));
|
||||
|
|
@ -403,7 +405,9 @@ final class ApiController extends Controller
|
|||
$position = $this->createPositionFromRequest($request);
|
||||
$this->createModel($request->header->account, $position, PositionMapper::class, 'position', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION)->content === '1') {
|
||||
/** @var \Model\Setting $setting */
|
||||
$setting = $this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_POSITION);
|
||||
if ($setting->content === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->header->account = $request->header->account;
|
||||
$newRequest->setData('name', 'org:pos:' . \str_replace(' ', '_', \strtolower($position->name)));
|
||||
|
|
@ -577,7 +581,9 @@ final class ApiController extends Controller
|
|||
$department = $this->createDepartmentFromRequest($request);
|
||||
$this->createModel($request->header->account, $department, DepartmentMapper::class, 'department', $request->getOrigin());
|
||||
|
||||
if ($this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT)->content === '1') {
|
||||
/** @var \Model\Setting $setting */
|
||||
$setting = $this->app->appSettings->get(null, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT);
|
||||
if ($setting->content === '1') {
|
||||
$newRequest = new HttpRequest();
|
||||
$newRequest->header->account = $request->header->account;
|
||||
$newRequest->setData('name', 'org:dep:' . \strtolower($department->name));
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ class DepartmentTagSelectorPopupView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:null|string} $data */
|
||||
$this->id = $data[0] ?? $this->id;
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,11 @@ class DepartmentTagSelectorView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:string, 1:string, 2:null|bool} $data */
|
||||
$this->id = $data[0];
|
||||
$this->name = $data[1];
|
||||
$this->isRequired = $data[2] ?? false;
|
||||
|
||||
$this->getData('department-selector-popup')->setId($this->id);
|
||||
|
||||
return parent::render();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ class PositionTagSelectorPopupView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:null|string} $data */
|
||||
$this->id = $data[0] ?? $this->id;
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,11 @@ class PositionTagSelectorView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:string, 1:string, 2:null|bool} $data */
|
||||
$this->id = $data[0];
|
||||
$this->name = $data[1];
|
||||
$this->isRequired = $data[2] ?? false;
|
||||
|
||||
$this->getData('position-selector-popup')->setId($this->id);
|
||||
|
||||
return parent::render();
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ class UnitTagSelectorPopupView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:null|string} $data */
|
||||
|
||||
$this->id = $data[0] ?? $this->id;
|
||||
return parent::render();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ class UnitTagSelectorView extends View
|
|||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:string, 1:string, 2:null|bool} $data */
|
||||
$this->id = $data[0];
|
||||
$this->name = $data[1];
|
||||
$this->isRequired = $data[2] ?? false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user