From f19f8fd8c0465f0cb679236d83243c87cf384ae8 Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Fri, 7 Jul 2023 04:56:11 +0330 Subject: [PATCH] chore: refactor "substr" calls to improve code readability Signed-off-by: Hamid Dehnavi --- lib/public/AppFramework/AuthPublicShareController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index 9c912d0e9a670..b79f530dc4dcd 100644 --- a/lib/public/AppFramework/AuthPublicShareController.php +++ b/lib/public/AppFramework/AuthPublicShareController.php @@ -189,7 +189,7 @@ final public function getAuthenticationRedirect(string $redirect): RedirectRespo private function getRoute(string $function): string { $app = strtolower($this->appName); $class = (new \ReflectionClass($this))->getShortName(); - if (substr($class, -10) === 'Controller') { + if (str_ends_with($class, 'Controller')) { $class = substr($class, 0, -10); } return $app .'.'. $class .'.'. $function;