findElementsOverridingGloballyDisallowedAttributes example


  private static function validateAllowedRestrictionsPhase5(array $elements): void {
    $conflict = self::findElementsOverridingGloballyDisallowedAttributes($elements);
    if ($conflict) {
      [$globally_disallowed_attribute_restrictions$elements_overriding_globally_disallowed_attributes] = $conflict;
      throw new \InvalidArgumentException(sprintf(
        'The attribute restrictions in "%s" are allowing attributes "%s" that are disallowed by the special "*" global attribute restrictions.',
        implode(' ', (new self($elements_overriding_globally_disallowed_attributes))->toCKEditor5ElementsArray()),
        implode('", "', array_keys($globally_disallowed_attribute_restrictions))
      ));
    }
  }

  /** * Finds elements overriding globally disallowed attributes. * * @param array $elements * The allowed elements. * * @return null|array * NULL if no conflict is found, an array containing otherwise, containing: * - the globally disallowed attribute restrictions * - the elements overriding globally disallowed attributes */
Home | Imprint | This part of the site doesn't use cookies.