From 8f7e1c3fc13fb77a6532be8537b0fce128b90afe Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Mon, 28 Oct 2024 12:07:22 -0600 Subject: [PATCH] phpcs Assets/Middleware --- tests/Assets/Middleware/BindableEntity.php | 12 ++++++++---- .../Middleware/BindableEntityWithInterface.php | 12 ++++++++---- tests/Assets/Middleware/EntityController.php | 17 +++++++++++------ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/tests/Assets/Middleware/BindableEntity.php b/tests/Assets/Middleware/BindableEntity.php index 9298ceae..3d5bdaed 100644 --- a/tests/Assets/Middleware/BindableEntity.php +++ b/tests/Assets/Middleware/BindableEntity.php @@ -1,19 +1,23 @@ id; } - public function getName() + public function getName(): string { return strtolower($this->name); } diff --git a/tests/Assets/Middleware/BindableEntityWithInterface.php b/tests/Assets/Middleware/BindableEntityWithInterface.php index 71304f8e..b0395447 100644 --- a/tests/Assets/Middleware/BindableEntityWithInterface.php +++ b/tests/Assets/Middleware/BindableEntityWithInterface.php @@ -1,21 +1,25 @@ id; } - public function getName() + public function getName(): string { return strtolower($this->name); } diff --git a/tests/Assets/Middleware/EntityController.php b/tests/Assets/Middleware/EntityController.php index 768e14e7..b1e425de 100644 --- a/tests/Assets/Middleware/EntityController.php +++ b/tests/Assets/Middleware/EntityController.php @@ -1,35 +1,40 @@ getName(); } - public function interfacer(BindableEntityWithInterface $entity) + public function interfacer(BindableEntityWithInterface $entity): int { return $entity->getId(); } - public function returnValue(string $value) + public function returnValue(string $value): string { return $value; } - public function returnEntity(BindableEntity $entity = null) { + public function returnEntity(BindableEntity|null $entity = null): BindableEntity|null + { return $entity; } - public function returnEntityName(BindableEntity $entity) { + public function returnEntityName(BindableEntity $entity): string + { return $entity->getName(); } - public function checkRequest(Request $request) { + public function checkRequest(Request $request): string + { return $request instanceof Request ? 'request' : 'something else'; } }