Skip to content

Commit

Permalink
Allow to pass context
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Jan 30, 2015
1 parent e27d31f commit 8682ec3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Mvc/Controller/Plugin/ValidateIncomingData.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public function __construct(InputFilterPluginManager $inputFilterPluginManager)
*
* @param string $inputFilterName
* @param array $validationGroup
* @param mixed $context
* @return array
* @throws UnprocessableEntityException
*/
public function __invoke($inputFilterName, array $validationGroup = [])
public function __invoke($inputFilterName, array $validationGroup = [], $context = null)
{
/** @var \Zend\InputFilter\InputFilterInterface $inputFilter */
$inputFilter = $this->inputFilterPluginManager->get($inputFilterName);
Expand All @@ -64,7 +65,7 @@ public function __invoke($inputFilterName, array $validationGroup = [])
$data = json_decode($this->controller->getRequest()->getContent(), true);
$inputFilter->setData($data);

if ($inputFilter->isValid()) {
if ($inputFilter->isValid($context)) {
return $inputFilter->getValues();
}

Expand Down

0 comments on commit 8682ec3

Please sign in to comment.