-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#5905Labels
Description
I've run Rector on one legacy project and noticed the type declaration set missed a try/catch case.
It's pretty straight forward so we should hook into 1st-level TryCatch node:
-public function some()
+public function some(): int
{
try {
return 100;
} catch (Exception $exception) {
// some logging
throw $exception;
}
}It should handle any returns of known native value, e.g.:
return 100 + 5;
// or
return $this->getInteger();
// ...
public function getInteger()
{
return 100;
}Reactions are currently unavailable