mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
fix: SA: Fix "might not be defined" rule.
SA stands for Static Analysis.
This commit is contained in:
@@ -274,6 +274,8 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface
|
||||
$jsonCriterias
|
||||
);
|
||||
|
||||
$entity = null;
|
||||
|
||||
switch (true) {
|
||||
case count($results) === 0:
|
||||
$entity = $repository->getClassName();
|
||||
@@ -291,6 +293,10 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface
|
||||
);
|
||||
}
|
||||
|
||||
if (null === $entity) {
|
||||
throw new Exception('Unable to create entity.');
|
||||
}
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user