From 838d0b08db42a9f4f487e3dbc5dc15c0dcb0e4fa Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 16 Oct 2022 11:33:32 +0300 Subject: [PATCH] move default binding --- .../Binding/DefaultBinding.php => Binding.php} | 13 ++++++++++--- application/Espo/Core/Binding/EspoBindingLoader.php | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) rename application/Espo/{Core/Binding/DefaultBinding.php => Binding.php} (95%) diff --git a/application/Espo/Core/Binding/DefaultBinding.php b/application/Espo/Binding.php similarity index 95% rename from application/Espo/Core/Binding/DefaultBinding.php rename to application/Espo/Binding.php index c2719fb33e..f88030c1e4 100644 --- a/application/Espo/Core/Binding/DefaultBinding.php +++ b/application/Espo/Binding.php @@ -27,11 +27,18 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -namespace Espo\Core\Binding; +namespace Espo; -use Espo\Core\Authentication\Jwt\SignatureVerifierFactory; +use Espo\Core\Binding\Binder; +use Espo\Core\Binding\BindingProcessor; -class DefaultBinding implements BindingProcessor +/** + * Default binding for the dependency injection framework. Custom binding should be set up in + * `Espo\Modules\{ModuleName}\Binding` or `Espo\Custom\Binding`. + * + * @link https://docs.espocrm.com/development/di/#binding. + */ +class Binding implements BindingProcessor { public function process(Binder $binder): void { diff --git a/application/Espo/Core/Binding/EspoBindingLoader.php b/application/Espo/Core/Binding/EspoBindingLoader.php index 87a00324fc..c9f8ddf78f 100644 --- a/application/Espo/Core/Binding/EspoBindingLoader.php +++ b/application/Espo/Core/Binding/EspoBindingLoader.php @@ -30,6 +30,7 @@ namespace Espo\Core\Binding; use Espo\Core\Utils\Module; +use Espo\Binding; class EspoBindingLoader implements BindingLoader { @@ -46,7 +47,7 @@ class EspoBindingLoader implements BindingLoader $binder = new Binder($data); - (new DefaultBinding())->process($binder); + (new Binding())->process($binder); foreach ($this->moduleNameList as $moduleName) { $this->loadModule($binder, $moduleName);