validateKeys example


  public function setData(array $data) {
    $data = $this->castSafeStrings($data);
    $this->validateKeys($data);
    $this->data = $data;
    return $this;
  }

  /** * Sets a value in this configuration object. * * @param string $key * Identifier to store value in configuration. * @param mixed $value * Value to associate with identifier. * * @return $this * The configuration object. * * @throws \Drupal\Core\Config\ConfigValueException * If $value is an array and any of its keys in any depth contains a dot. */
                $this->values[$key] = null;
            }
        } else {
            $value = $this->storeSerialized ? $this->unfreeze($key$isHit) : $this->values[$key];
        }

        return (self::$createCacheItem)($key$value$isHit$this->tags[$key] ?? null);
    }

    public function getItems(array $keys = []): iterable
    {
        \assert(self::validateKeys($keys));

        return $this->generateItems($keysmicrotime(true), self::$createCacheItem);
    }

    public function deleteItem(mixed $key): bool
    {
        \assert('' !== CacheItem::validateKey($key));
        unset($this->values[$key]$this->tags[$key]$this->expiries[$key]);

        return true;
    }

    
Home | Imprint | This part of the site doesn't use cookies.