activate bleeding edge phpstan rules (#2898)

This commit is contained in:
Kevin Papst
2021-11-02 13:33:21 +01:00
committed by GitHub
parent 36c08b0dea
commit 1b35356f81
32 changed files with 73 additions and 142 deletions

View File

@@ -19,7 +19,6 @@ use App\Reporting\WeekByUser;
use App\Reporting\WeekByUserForm;
use App\Repository\ActivityRepository;
use App\Repository\ProjectRepository;
use App\Repository\TimesheetRepository;
use App\Timesheet\TimesheetStatisticService;
use DateTime;
use Exception;
@@ -35,14 +34,12 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
*/
final class ReportByUserController extends AbstractController
{
private $timesheetRepository;
private $statisticService;
private $projectRepository;
private $activityRepository;
public function __construct(TimesheetRepository $timesheetRepository, TimesheetStatisticService $statisticService, ProjectRepository $projectRepository, ActivityRepository $activityRepository)
public function __construct(TimesheetStatisticService $statisticService, ProjectRepository $projectRepository, ActivityRepository $activityRepository)
{
$this->timesheetRepository = $timesheetRepository;
$this->statisticService = $statisticService;
$this->projectRepository = $projectRepository;
$this->activityRepository = $activityRepository;

View File

@@ -20,7 +20,6 @@ use App\Reporting\WeeklyUserListForm;
use App\Reporting\YearlyUserList;
use App\Reporting\YearlyUserListForm;
use App\Repository\Query\UserQuery;
use App\Repository\TimesheetRepository;
use App\Repository\UserRepository;
use App\Timesheet\TimesheetStatisticService;
use Exception;
@@ -35,12 +34,10 @@ use Symfony\Component\Routing\Annotation\Route;
*/
final class ReportUsersListController extends AbstractController
{
private $timesheetRepository;
private $userRepository;
public function __construct(TimesheetRepository $timesheetRepository, UserRepository $userRepository)
public function __construct(UserRepository $userRepository)
{
$this->timesheetRepository = $timesheetRepository;
$this->userRepository = $userRepository;
}

View File

@@ -176,15 +176,13 @@ final class TeamController extends AbstractController
$customerForm->handleRequest($request);
if ($customerForm->isSubmitted() && $customerForm->isValid()) {
if ($customerForm->isValid()) {
try {
$this->repository->saveTeam($team);
$this->flashSuccess('action.update.success');
try {
$this->repository->saveTeam($team);
$this->flashSuccess('action.update.success');
return $this->redirectToRoute('admin_team_edit', ['id' => $team->getId()]);
} catch (\Exception $ex) {
$this->flashUpdateException($ex);
}
return $this->redirectToRoute('admin_team_edit', ['id' => $team->getId()]);
} catch (\Exception $ex) {
$this->flashUpdateException($ex);
}
}
@@ -194,15 +192,13 @@ final class TeamController extends AbstractController
$projectForm->handleRequest($request);
if ($projectForm->isSubmitted() && $projectForm->isValid()) {
if ($projectForm->isValid()) {
try {
$this->repository->saveTeam($team);
$this->flashSuccess('action.update.success');
try {
$this->repository->saveTeam($team);
$this->flashSuccess('action.update.success');
return $this->redirectToRoute('admin_team_edit', ['id' => $team->getId()]);
} catch (\Exception $ex) {
$this->flashUpdateException($ex);
}
return $this->redirectToRoute('admin_team_edit', ['id' => $team->getId()]);
} catch (\Exception $ex) {
$this->flashUpdateException($ex);
}
}
}