From c7ef8925eacda57efcb066037ebc32bfe6f928f5 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Fri, 19 Sep 2025 08:25:56 +0300 Subject: [PATCH] Review comment changes --- app/src/Controller/Component/RegistryAuthComponent.php | 1 - app/src/Lib/Util/StringUtilities.php | 6 +++--- app/src/View/Helper/FieldHelper.php | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/Controller/Component/RegistryAuthComponent.php b/app/src/Controller/Component/RegistryAuthComponent.php index d8c3f8d74..02afc8f52 100644 --- a/app/src/Controller/Component/RegistryAuthComponent.php +++ b/app/src/Controller/Component/RegistryAuthComponent.php @@ -49,7 +49,6 @@ namespace App\Controller\Component; -use App\Model\Entity; use \App\Lib\Enum\AuthenticationEventEnum; use \App\Lib\Enum\SuspendableStatusEnum; use \App\Lib\Enum\TemplateableStatusEnum; diff --git a/app/src/Lib/Util/StringUtilities.php b/app/src/Lib/Util/StringUtilities.php index feed2b562..1fde28fc4 100644 --- a/app/src/Lib/Util/StringUtilities.php +++ b/app/src/Lib/Util/StringUtilities.php @@ -146,7 +146,7 @@ public static function columnKey( // Otherwise look for the general key $cfield = __d('field', $c); - return ($cfield !== $c) ? $cfield : \Cake\Utility\Inflector::humanize($c); + return ($cfield !== $c) ? $cfield : Inflector::humanize($c); } /** @@ -188,7 +188,7 @@ public static function pluginToTextDomain(?string $plugin): string if (empty($plugin)) { return 'operation'; } - return \Cake\Utility\Inflector::singularize(\Cake\Utility\Inflector::tableize($plugin)); + return Inflector::underscore($plugin); } /** @@ -407,7 +407,7 @@ public static function localizeController(string $controllerName, ?string $plugi if ($pluginName) { // Localize via plugin - return __d(\Cake\Utility\Inflector::underscore($pluginName), 'controller.' . $controllerName, [$plural ? 99 : 1]); + return __d(Inflector::underscore($pluginName), 'controller.' . $controllerName, [$plural ? 99 : 1]); } // Standard Localization return __d('controller', $controllerName, [$plural ? 99 : 1]); diff --git a/app/src/View/Helper/FieldHelper.php b/app/src/View/Helper/FieldHelper.php index 57bda472c..60e3f9c31 100644 --- a/app/src/View/Helper/FieldHelper.php +++ b/app/src/View/Helper/FieldHelper.php @@ -104,9 +104,7 @@ public function calculateLabelAndDescription(string $fieldName): array $label = null; // First, try to autogenerate the field label (if we weren't given one). - $pluginDomain = (!empty($this->getPluginName()) - ? Inflector::underscore($this->getPluginName()) - : null); + $pluginDomain = StringUtilities::pluginToTextDomain($this->getPluginName()); $modelName = $this->getModelName(); // We try to automagically determine if a description for the field exists by