Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: François-Xavier de Guillebon <[email protected]>
  • Loading branch information
ThibautSF and deguif committed Dec 7, 2020
1 parent e90288a commit fcd3caa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Processor/ForeachProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function __construct(string $field, $processor)
} elseif (\is_array($processor)) {
$this->setRawProcessor($processor);
} else {
throw new \TypeError('Expected Elastica\Processor\AbstractProcessor or array');
throw new \TypeError(\sprintf('Argument 2 passed to %s::__construct() must be of type %s|array, %s given.', self::class, AbstractProcessor::class, \is_object($processor) ? \get_class($processor) : \gettype($processor)));

}
}

Expand All @@ -48,7 +49,7 @@ public function setField(string $field): self
*
* @return $this
*/
public function setProcessor(?AbstractProcessor $processor): self
public function setProcessor(AbstractProcessor $processor): self
{
return $this->setParam('processor', $processor);
}
Expand Down

0 comments on commit fcd3caa

Please sign in to comment.