hasNoNestedInstances example

/** * CacheableNormalization constructor. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability metadata for the normalized data. * @param array|string|int|float|bool|null $normalization * The normalized data. This value must not contain any * CacheableNormalizations. */
  public function __construct(CacheableDependencyInterface $cacheability$normalization) {
    assert((is_array($normalization) && static::hasNoNestedInstances($normalization)) || is_string($normalization) || is_int($normalization) || is_float($normalization) || is_bool($normalization) || is_null($normalization));
    $this->normalization = $normalization;
    $this->setCacheability($cacheability);
  }

  /** * Creates a CacheableNormalization instance without any special cacheability. * * @param array|string|int|float|bool|null $normalization * The normalized data. This value must not contain any * CacheableNormalizations. * * @return static * The CacheableNormalization. */
Home | Imprint | This part of the site doesn't use cookies.