Skip to content

Commit a0e80e3

Browse files
author
DKravtsov
committed
small improvements
1 parent 7f1ab2a commit a0e80e3

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

ecs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
'case',
8484
'continue',
8585
'curly_brace_block',
86-
'default', 'extra',
86+
'default',
87+
'extra',
8788
'parenthesis_brace_block',
8889
'return',
8990
'square_brace_block',

src/Decorator/StopwatchDecorator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use function array_filter;
1616
use function is_object;
17+
use function str_contains;
1718
use function str_starts_with;
1819

1920
/**
@@ -39,6 +40,7 @@ public function decorate(object $service): object
3940
$class->getFileName() === false
4041
|| $class->isFinal()
4142
|| str_starts_with($class->getName(), 'ProxyManagerGeneratedProxy')
43+
|| str_contains($class->getName(), 'RequestStack')
4244
) {
4345
return $service;
4446
}

src/Repository/Interfaces/BaseRepositoryInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace App\Repository\Interfaces;
66

77
use App\Entity\Interfaces\EntityInterface;
8+
use Doctrine\DBAL\LockMode;
9+
use Doctrine\ORM\AbstractQuery;
810
use Doctrine\ORM\EntityManager;
911
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1012
use Doctrine\ORM\NonUniqueResultException;
@@ -68,6 +70,8 @@ public function createQueryBuilder(?string $alias = null, ?string $indexBy = nul
6870
/**
6971
* Wrapper for default Doctrine repository find method.
7072
*
73+
* @psalm-param LockMode::*|null $lockMode
74+
*
7175
* @throws ORMException
7276
* @throws OptimisticLockException
7377
* @throws TransactionRequiredException
@@ -78,6 +82,8 @@ public function find(string $id, ?int $lockMode = null, ?int $lockVersion = null
7882
* Advanced version of find method, with this you can process query as you like, eg. add joins and callbacks to
7983
* modify / optimize current query.
8084
*
85+
* @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode
86+
*
8187
* @psalm-return array<int|string, mixed>|EntityInterface|null
8288
*
8389
* @throws NonUniqueResultException

src/Repository/Traits/RepositoryMethodsTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use App\Entity\Interfaces\EntityInterface;
88
use App\Rest\RepositoryHelper;
99
use App\Rest\UuidHelper;
10+
use Doctrine\DBAL\LockMode;
11+
use Doctrine\ORM\AbstractQuery;
1012
use Doctrine\ORM\NonUniqueResultException;
1113
use Doctrine\ORM\NoResultException;
1214
use Doctrine\ORM\OptimisticLockException;
@@ -29,7 +31,7 @@ trait RepositoryMethodsTrait
2931
/**
3032
* Wrapper for default Doctrine repository find method.
3133
*
32-
* @phpstan-param 0|1|2|4|null $lockMode
34+
* @psalm-param LockMode::*|null $lockMode
3335
*
3436
* @throws TransactionRequiredException
3537
* @throws OptimisticLockException
@@ -46,7 +48,7 @@ public function find(string $id, ?int $lockMode = null, ?int $lockVersion = null
4648
/**
4749
* {@inheritdoc}
4850
*
49-
* @phpstan-param 1|2|3|4|5|6|string|null $hydrationMode
51+
* @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode
5052
*/
5153
public function findAdvanced(string $id, string | int | null $hydrationMode = null): null | array | EntityInterface
5254
{

0 commit comments

Comments
 (0)