[TOOLS] Fix errors found by PHPStan

This commit is contained in:
2021-12-21 12:17:51 +00:00
parent fa863d9e03
commit da8c41e094
3 changed files with 19 additions and 6 deletions

View File

@@ -33,6 +33,10 @@ declare(strict_types = 1);
namespace App\Core\Controller;
use App\Core\Controller;
use App\Core\DB\DB;
use function App\Core\I18n\_m;
use App\Util\Exception\ClientException;
use App\Util\Exception\RedirectException;
abstract class ActorController extends Controller
{
@@ -43,7 +47,7 @@ abstract class ActorController extends Controller
{
$actor = DB::findOneBy('actor', ['id' => $id]);
if ($actor->getIsLocal()) {
return new RedirectResponse($actor->getUrl());
throw new RedirectException($actor->getUrl());
}
if (empty($actor)) {
throw new ClientException(_m('No such actor.'), 404);