diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 776434f..fd47f56 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -29,8 +29,8 @@ class Navigation /** * Install navigation providing * - * @param string $path Module path - * @param ApplicationAbstract $app Application + * @param string $path Module path + * @param ApplicationAbstract $app Application * * @return void * diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 7804181..464ba16 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/contract/list.*$' => [ + '^.*/contract/list.*$' => [ [ 'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractList', 'verb' => RouteVerb::GET, diff --git a/Controller/ApiController.php b/Controller/ApiController.php index d89b25d..622014a 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -42,7 +42,7 @@ use Modules\ContractManagement\Models\ContractMapper; */ final class ApiController extends Controller { - /** + /** * Api method to create a contract * * @param RequestAbstract $request Request @@ -57,7 +57,7 @@ final class ApiController extends Controller */ public function apiContractCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { - if (!empty($val = $this->validateContractCreate($request))) { + if (!empty($val = $this->validateContractCreate($request))) { $response->set('contract_create', new FormValidation($val)); $response->header->status = RequestStatusCode::R_400; @@ -103,11 +103,11 @@ final class ApiController extends Controller */ private function createContractFromRequest(RequestAbstract $request) : Contract { - $contract = new Contract(); - $contract->title = (string) ($request->getData('title') ?? ''); + $contract = new Contract(); + $contract->title = (string) ($request->getData('title') ?? ''); $contract->description = (string) ($request->getData('description') ?? ''); - $contract->type = new NullContractType((int) ($request->getData('type') ?? 0)); - $contract->start = new \DateTime($request->getData('start') ?? 'now'); + $contract->type = new NullContractType((int) ($request->getData('type') ?? 0)); + $contract->start = new \DateTime($request->getData('start') ?? 'now'); if (!empty($request->getData('end'))) { $contract->end = new \DateTime($request->getData('end')); @@ -202,7 +202,7 @@ final class ApiController extends Controller */ private function createContractTypeFromRequest(RequestAbstract $request) : ContractType { - $contractType = new ContractType(); + $contractType = new ContractType(); $contractType->name = (string) ($request->getData('name') ?? ''); return $contractType; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index d0c5322..d796bee 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -36,7 +36,7 @@ use Modules\ContractManagement\Models\ContractMapper; */ final class BackendController extends Controller { - /** + /** * Routing end-point for application behaviour. * * @param RequestAbstract $request Request diff --git a/Models/Contract.php b/Models/Contract.php index ba3db57..f334b7a 100644 --- a/Models/Contract.php +++ b/Models/Contract.php @@ -77,7 +77,7 @@ class Contract */ public function __construct() { - $this->createdAt = new \DateTimeImmutable('now'); + $this->createdAt = new \DateTimeImmutable('now'); } /** diff --git a/Models/ContractType.php b/Models/ContractType.php index 0f60880..1b54edd 100644 --- a/Models/ContractType.php +++ b/Models/ContractType.php @@ -48,9 +48,7 @@ class ContractType implements \JsonSerializable, ArrayableInterface * * @var ContractTypeL11n */ - protected string | - - ContractTypeL11n $l11n; + protected string | ContractTypeL11n $l11n; /** * Constructor. @@ -82,22 +80,22 @@ class ContractType implements \JsonSerializable, ArrayableInterface * Set l11n * * @param string|ContractTypeL11n $l11n Tag article l11n - * @param string $lang Language + * @param string $lang Language * * @return void * * @since 1.0.0 */ - public function setL11n($l11n, string $lang = ISO639x1Enum::_EN) : void + public function setL11n(string|ContractTypeL11n $l11n, string $lang = ISO639x1Enum::_EN) : void { if ($l11n instanceof ContractTypeL11n) { $this->l11n = $l11n; - } elseif (\is_string($l11n)) { + } elseif ($this->l11n instanceof ContractTypeL11n) { + $this->l11n->title = $l11n; + } else { $this->l11n = new ContractTypeL11n(); $this->l11n->title = $l11n; $this->l11n->setLanguage($lang); - } elseif ($this->l11n instanceof ContractTypeL11n && \is_string($l11n)) { - $this->l11n->title = $l11n; } } diff --git a/Models/ContractTypeL11n.php b/Models/ContractTypeL11n.php index 7092063..7da01e5 100644 --- a/Models/ContractTypeL11n.php +++ b/Models/ContractTypeL11n.php @@ -41,9 +41,7 @@ class ContractTypeL11n implements \JsonSerializable, ArrayableInterface * @var int|ContractType * @since 1.0.0 */ - protected int | - -ContractType $type = 0; + protected int | ContractType $type = 0; /** * Language. @@ -65,8 +63,8 @@ ContractType $type = 0; * Constructor. * * @param int|ContractType $type Attribute type - * @param string $title Localized title - * @param string $language Language + * @param string $title Localized title + * @param string $language Language * * @since 1.0.0 */ diff --git a/Theme/Backend/contract-single.tpl.php b/Theme/Backend/contract-single.tpl.php index 33c5d8e..8863029 100644 --- a/Theme/Backend/contract-single.tpl.php +++ b/Theme/Backend/contract-single.tpl.php @@ -33,14 +33,14 @@ echo $this->getData('nav')->render(); ?>
request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
-
-
-
+
+
+
- request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>> + request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
-
-
-
+
+
+