You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/DI/Resolver.php
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ public function resolveEntityType(Statement $statement): ?string
127
127
128
128
$type = Helpers::getReturnType($reflection);
129
129
if ($type && !class_exists($type) && !interface_exists($type)) {
130
-
thrownewServiceCreationException(sprintf("Class or interface '%s' not found. Is return type of %s() correct?", $type, Nette\Utils\Callback::toString($entity)));
130
+
thrownewServiceCreationException(sprintf("Class or interface '%s' not found. Check the return type of %s() method.", $type, Nette\Utils\Callback::toString($entity)));
131
131
}
132
132
return$type;
133
133
@@ -136,11 +136,12 @@ public function resolveEntityType(Statement $statement): ?string
136
136
137
137
} elseif (is_string($entity)) { // class
138
138
if (!class_exists($entity)) {
139
-
thrownewServiceCreationException(
139
+
thrownewServiceCreationException(sprintf(
140
140
interface_exists($entity)
141
-
? "Interface $entity can not be used as 'factory', did you mean 'implement'?"
142
-
: "Class $entity not found."
143
-
);
141
+
? "Interface %s can not be used as 'factory', did you mean 'implement'?"
142
+
: "Class '%s' not found.",
143
+
$entity
144
+
));
144
145
}
145
146
return$entity;
146
147
}
@@ -205,7 +206,7 @@ public function completeStatement(Statement $statement, bool $currentServiceAllo
205
206
206
207
caseis_string($entity): // create class
207
208
if (!class_exists($entity)) {
208
-
thrownewServiceCreationException("Class $entity not found.");
209
+
thrownewServiceCreationException(sprintf("Class '%s' not found.", $entity));
0 commit comments