Skip to content

Commit c91aed9

Browse files
#60 Apply phpstan rules
1 parent 77464bf commit c91aed9

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

src/Controller/Admin/LogRecordCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
use Symfony\Component\HttpFoundation\RequestStack;
3333
use Symfony\Component\Security\Http\Attribute\IsGranted;
3434

35+
/**
36+
* @phpstan-template TEntity of AbstractCrudController
37+
*
38+
* @phpstan-extends AbstractCrudController<LogRecord>
39+
*/
3540
#[IsGranted('ROLE_USER')]
3641
class LogRecordCrudController extends AbstractCrudController
3742
{

src/Controller/Admin/ProcessExecutionCrudController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
use Symfony\Component\Security\Http\Attribute\IsGranted;
3535
use Symfony\Contracts\Translation\TranslatorInterface;
3636

37+
/**
38+
* @phpstan-template TEntity of AbstractCrudController
39+
*
40+
* @phpstan-extends AbstractCrudController<ProcessExecution>
41+
*/
3742
#[IsGranted('ROLE_USER')]
3843
class ProcessExecutionCrudController extends AbstractCrudController
3944
{
@@ -117,7 +122,9 @@ public function showLogs(AdminContext $adminContext): RedirectResponse
117122
[
118123
'process' => [
119124
'comparison' => '=',
120-
'value' => $this->getContext()?->getEntity()->getInstance()->getId(),
125+
'value' => $this->getContext()?->getEntity()->getInstance() instanceof ProcessExecution
126+
? $this->getContext()->getEntity()->getInstance()->getId()
127+
: null,
121128
],
122129
]
123130
)

src/Controller/Admin/ProcessScheduleCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
use Symfony\Component\Process\Process;
3737
use Symfony\Component\Scheduler\Trigger\CronExpressionTrigger;
3838

39+
/**
40+
* @phpstan-template TEntity of AbstractCrudController
41+
*
42+
* @phpstan-extends AbstractCrudController<ProcessSchedule>
43+
*/
3944
class ProcessScheduleCrudController extends AbstractCrudController
4045
{
4146
public function __construct(private readonly ProcessConfigurationsManager $processConfigurationsManager)

src/Controller/Admin/UserCrudController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
use Symfony\Component\PasswordHasher\Hasher\Pbkdf2PasswordHasher;
3333
use Symfony\Component\Security\Http\Attribute\IsGranted;
3434

35+
/**
36+
* @phpstan-template TEntity of AbstractCrudController
37+
*
38+
* @phpstan-extends AbstractCrudController<User>
39+
*/
3540
#[IsGranted('ROLE_USER')]
3641
class UserCrudController extends AbstractCrudController
3742
{

0 commit comments

Comments
 (0)