You are here

public static function Error::methodNotFound in JSON-RPC 2.x

Same name and namespace in other branches
  1. 8 src/Object/Error.php \Drupal\jsonrpc\Object\Error::methodNotFound()

Constructs a new method not found error.

Parameters

string $method_name: The name of the missing method.

\Drupal\Core\Cache\CacheableDependencyInterface $cacheability: (optional) A cacheable dependency.

Return value

static

3 calls to Error::methodNotFound()
Handler::doExecution in src/Handler.php
Gets an anonymous function which executes the RPC method.
Handler::getExecutable in src/Handler.php
Gets an executable instance of an RPC method.
RpcRequestFactory::denormalizeParams in src/Shaper/RpcRequestFactory.php
Denormalizes a JSON-RPC request object's parameters.

File

src/Object/Error.php, line 161

Class

Error
Error class to help implement JSON RPC's spec for errors.

Namespace

Drupal\jsonrpc\Object

Code

public static function methodNotFound($method_name, CacheableDependencyInterface $cacheability = NULL) {
  $data = sprintf(static::$errorMeanings[static::METHOD_NOT_FOUND], $method_name);
  return new static(static::METHOD_NOT_FOUND, static::$errorMessages[static::METHOD_NOT_FOUND], $data, $cacheability);
}