Skip to content

Commit

Permalink
Fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Apr 19, 2022
1 parent a420b52 commit 43d63f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ parameters:
- '/Parameter \#1 \$array[0-9]? of function array_multisort expects array, array\|int given\./'
- '/Parameter \#2 \$class of static method Webmozart\\Assert\\Assert::isInstanceOf\(\) expects class-string<object>, string given./'
- '/Parameter \#1 \$objectOrClass of class ReflectionClass constructor expects class-string<object>|object, object|string given./'
- '/Parameter \#1 \$package of method Symfony\\Component\\DependencyInjection\\Alias::setDeprecated\(\)/'
- '/Return typehint of method Sylius\\Bundle\\ResourceBundle\\Routing\\CrudRoutesAttributesLoader::getClassAttributes\(\) has invalid type ReflectionAttribute./'
- '/Return typehint of method Sylius\\Bundle\\ResourceBundle\\Routing\\RoutesAttributesLoader::getClassAttributes\(\) has invalid type ReflectionAttribute./'
- '/Unable to resolve the template type ExpectedType in call to method static method Webmozart\\Assert\\Assert::isInstanceOf\(\)/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(ServerParams $serverParams = null)
$this->serverParams = $serverParams ?: new ServerParams();
}

public function handleRequest(FormInterface $form, $request = null): void
public function handleRequest(FormInterface $form, mixed $request = null): void
{
if (!$request instanceof Request) {
throw new UnexpectedTypeException($request, 'Symfony\Component\HttpFoundation\Request');
Expand Down Expand Up @@ -107,7 +107,7 @@ public function handleRequest(FormInterface $form, $request = null): void
$form->submit($data, 'PATCH' !== $method);
}

public function isFileUpload($data): bool
public function isFileUpload(mixed $data): bool
{
return $data instanceof File;
}
Expand Down

0 comments on commit 43d63f3

Please sign in to comment.