From 39c0da248b7256c500a9ddede1002c8cf8ae55fa Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 21 May 2023 10:05:48 +0300 Subject: [PATCH] cs --- application/Espo/Core/InjectableFactory.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/Espo/Core/InjectableFactory.php b/application/Espo/Core/InjectableFactory.php index 76cc1370d3..24bb4649fd 100644 --- a/application/Espo/Core/InjectableFactory.php +++ b/application/Espo/Core/InjectableFactory.php @@ -118,13 +118,13 @@ class InjectableFactory $class = new ReflectionClass($interfaceName); if ($class->isInterface()) { - throw new RuntimeException("Could not resolve interface `{$interfaceName}`."); + throw new RuntimeException("Could not resolve interface `$interfaceName`."); } $obj = $this->createInternal($interfaceName, null, $bindingContainer); if (!$obj instanceof $interfaceName) { - throw new RuntimeException("Class `{$interfaceName}` resolved to another type."); + throw new RuntimeException("Class `$interfaceName` resolved to another type."); } return $obj; @@ -137,13 +137,13 @@ class InjectableFactory ]; if (!in_array($binding->getType(), $typeList)) { - throw new RuntimeException("Bad resolution for interface `{$interfaceName}`."); + throw new RuntimeException("Bad resolution for interface `$interfaceName`."); } $obj = $this->resolveBinding($binding, $bindingContainer); if (!$obj instanceof $interfaceName) { - throw new RuntimeException("Class `{$interfaceName}` resolved to another type."); + throw new RuntimeException("Class `$interfaceName` resolved to another type."); } return $obj; @@ -162,7 +162,7 @@ class InjectableFactory ): object { if (!class_exists($className)) { - throw new RuntimeException("InjectableFactory: Class '{$className}' does not exist."); + throw new RuntimeException("InjectableFactory: Class '$className' does not exist."); } $class = new ReflectionClass($className); @@ -287,14 +287,14 @@ class InjectableFactory if (!$class) { throw new RuntimeException( - "InjectableFactory: Could not resolve the dependency '{$name}' for a callback." + "InjectableFactory: Could not resolve the dependency '$name' for a callback." ); } $className = $class->getName(); throw new RuntimeException( - "InjectableFactory: Could not create '{$className}', the dependency '{$name}' is not resolved." + "InjectableFactory: Could not create '$className', the dependency '$name' is not resolved." ); } @@ -389,7 +389,7 @@ class InjectableFactory foreach ($class->getInterfaces() as $interface) { $interfaceName = $interface->getShortName(); - if (substr($interfaceName, -5) !== 'Aware' || strlen($interfaceName) <= 5) { + if (!str_ends_with($interfaceName, 'Aware') || strlen($interfaceName) <= 5) { continue; }