You are here

public function JsonRpcMethod::areParamsPositional in JSON-RPC 8

Same name and namespace in other branches
  1. 2.x src/Annotation/JsonRpcMethod.php \Drupal\jsonrpc\Annotation\JsonRpcMethod::areParamsPositional()

Whether the parameters are by-position.

Return value

bool True if the parameters are positional.

Overrides MethodInterface::areParamsPositional

File

src/Annotation/JsonRpcMethod.php, line 90

Class

JsonRpcMethod
Defines a JsonRpcParameterDefinition annotation object.

Namespace

Drupal\jsonrpc\Annotation

Code

public function areParamsPositional() {
  return array_reduce(array_keys($this
    ->getParams()), function ($positional, $key) {
    return $positional ? !is_string($key) : $positional;
  }, TRUE);
}