5use InvalidArgumentException;
9use Psr\Http\Message\UploadedFileInterface;
42 return $this->request->getPathParams();
45 return $this->request->getQueryParams();
48 return $this->request->getPostParams();
51 throw new InvalidArgumentException( __METHOD__ .
": Invalid source '$source'" );
55 public function hasParam( $name, array $options ) {
57 return isset( $params[$name] );
60 public function getValue( $name, $default, array $options ) {
62 return $params[$name] ?? $default;
68 public function hasUpload( $name, array $options ) {
69 if ( $options[
'source'] !==
'post' ) {
76 if ( $options[
'source'] !==
'post' ) {
79 $upload = $this->request->getUploadedFiles()[$name] ??
null;
80 return $upload instanceof UploadedFileInterface ? $upload :
null;
88 return $this->permissionManager->userHasRight( $this->user,
'apihighlimits' );