You are here

protected static function LinkCollection::validKey in JSON:API 8.2

Ensures that a link key is valid.

Parameters

string $key: A key name.

Return value

bool TRUE if the key is valid, FALSE otherwise.

2 calls to LinkCollection::validKey()
LinkCollection::withLink in src/JsonApiResource/LinkCollection.php
Gets a new LinkCollection with the given link inserted.
LinkCollection::__construct in src/JsonApiResource/LinkCollection.php
LinkCollection constructor.

File

src/JsonApiResource/LinkCollection.php, line 195

Class

LinkCollection
Contains a set of JSON:API Link objects.

Namespace

Drupal\jsonapi\JsonApiResource

Code

protected static function validKey($key) {
  return is_string($key) && !is_numeric($key) && strpos($key, ':') === FALSE;
}