Skip to content

Commit 30a5635

Browse files
committed
Remove unneeded try/catch block, exception is thrown if class not exists, but we pass an instance
1 parent 7777a91 commit 30a5635

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ vendor/
4040
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
4141
# composer.lock
4242

43+
coverage/

src/Provider.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,9 @@ static private function build(string $className, $id, array $data): void
175175
self::$instances[$className][$id] = $instance;
176176
}
177177

178-
/**
179-
* @param StaticEntityInterface $instance
180-
* @param array $data
181-
*/
182178
static private function hydrate(StaticEntityInterface $instance, array $data): void
183179
{
184-
try {
185-
$reflectionClass = new \ReflectionClass($instance);
186-
} catch (\Throwable $e) {
187-
return;
188-
}
180+
$reflectionClass = new \ReflectionClass($instance);
189181

190182
foreach ($data as $key => $value) {
191183
if (!$reflectionClass->hasProperty($key)) {

0 commit comments

Comments
 (0)