function Mapping::getOptionalKeys

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Config/Schema/Mapping.php \Drupal\Core\Config\Schema\Mapping::getOptionalKeys()

Gets all optional keys in this mapping.

Return value

string[] A list of optional keys given the values in this mapping.

File

core/lib/Drupal/Core/Config/Schema/Mapping.php, line 206

Class

Mapping
Defines a mapping configuration element.

Namespace

Drupal\Core\Config\Schema

Code

public function getOptionalKeys() : array {
    return array_values(array_diff($this->getValidKeys(), $this->getRequiredKeys()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.