Skip to content

Commit

Permalink
Fix PHPStan warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Nov 20, 2024
1 parent d06231c commit c5bbc95
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/DBALTypesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function tryGetTypeForValue($value): ?Type
$classNameParts = explode('\\', str_replace('_', '\\', $className));
$typeName = array_pop($classNameParts);

if (null !== $typeName && array_key_exists($typeName, Type::getTypesMap())) {
if (array_key_exists($typeName, Type::getTypesMap())) {
return Type::getType($typeName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class SubstringExecutor
* @param int $offset
* @param int|null $length
*
* @return false|string
* @return string
*/
public function __invoke(string $string, int $offset, ?int $length = null)
{
Expand Down
9 changes: 0 additions & 9 deletions src/Query/QueryModifierCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Happyr\DoctrineSpecification\Query;

use Doctrine\ORM\QueryBuilder;
use Happyr\DoctrineSpecification\Exception\InvalidArgumentException;

final class QueryModifierCollection implements QueryModifier
{
Expand All @@ -41,14 +40,6 @@ public function __construct(...$children)
public function modify(QueryBuilder $qb, string $context): void
{
foreach ($this->children as $child) {
if (!$child instanceof QueryModifier) {
throw new InvalidArgumentException(sprintf(
'Child passed to QueryModifierCollection must be an instance of %s, but instance of %s found',
QueryModifier::class,
get_class($child)
));
}

$child->modify($qb, $context);
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/Result/ResultModifierCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Happyr\DoctrineSpecification\Result;

use Doctrine\ORM\AbstractQuery;
use Happyr\DoctrineSpecification\Exception\InvalidArgumentException;

final class ResultModifierCollection implements ResultModifier
{
Expand All @@ -40,14 +39,6 @@ public function __construct(...$children)
public function modify(AbstractQuery $query): void
{
foreach ($this->children as $child) {
if (!$child instanceof ResultModifier) {
throw new InvalidArgumentException(sprintf(
'Child passed to ResultModifierCollection must be an instance of %s, but instance of %s found',
ResultModifier::class,
get_class($child)
));
}

$child->modify($query);
}
}
Expand Down

0 comments on commit c5bbc95

Please sign in to comment.