Skip to content

Commit

Permalink
[Form] Add phpdoc to RequestHandlerInterface::isFileUpload() method
Browse files Browse the repository at this point in the history
  • Loading branch information
issei-m authored and nicolas-grekas committed Nov 20, 2017
1 parent 6321e01 commit 601fd9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Extension/HttpFoundation/HttpFoundationRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ public function handleRequest(FormInterface $form, $request = null)
$form->submit($data, 'PATCH' !== $method);
}

/**
* {@inheritdoc}
*/
public function isFileUpload($data)
{
return $data instanceof File;
Expand Down
3 changes: 3 additions & 0 deletions NativeRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public function handleRequest(FormInterface $form, $request = null)
$form->submit($data, 'PATCH' !== $method);
}

/**
* {@inheritdoc}
*/
public function isFileUpload($data)
{
// POST data will always be strings or arrays of strings. Thus, we can be sure
Expand Down
4 changes: 3 additions & 1 deletion RequestHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ interface RequestHandlerInterface
public function handleRequest(FormInterface $form, $request = null);

/**
* @param mixed $data
* Returns true if the given data is a file upload.
*
* @param mixed $data The form field data
*
* @return bool
*/
Expand Down

0 comments on commit 601fd9c

Please sign in to comment.