From f80741a7dafa35c52dec4bef70730de7ea4ec8cb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 17 Nov 2017 18:46:28 +0100 Subject: [PATCH] Explicit type cast --- Controller.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Controller.php b/Controller.php index f1d7977..86d8e58 100644 --- a/Controller.php +++ b/Controller.php @@ -302,8 +302,8 @@ class Controller extends ModuleAbstract implements WebInterface } $unit = new Unit(); - $unit->setName($request->getData('name')); - $unit->setDescription($request->getData('description') ?? ''); + $unit->setName((string) $request->getData('name')); + $unit->setDescription((string) ($request->getData('description') ?? '')); $unit->setStatus((int) $request->getData('status')); UnitMapper::create($unit); @@ -340,9 +340,9 @@ class Controller extends ModuleAbstract implements WebInterface } $position = new Position(); - $position->setName($request->getData('name')); + $position->setName((string) ($request->getData('name'))); $position->setStatus((int) $request->getData('status')); - $position->setDescription($request->getData('description') ?? ''); + $position->setDescription((string) ($request->getData('description') ?? '')); PositionMapper::create($position); @@ -377,9 +377,9 @@ class Controller extends ModuleAbstract implements WebInterface } $department = new Department(); - $department->setName($request->getData('name')); + $department->setName((string) $request->getData('name')); $department->setStatus((int) $request->getData('status')); - $department->setDescription($request->getData('description') ?? ''); + $department->setDescription((string) ($request->getData('description') ?? '')); DepartmentMapper::create($department);