original_string: protected function applyContexts(ConditionPluginCollection &$conditions, array $provided = []) {
      foreach ($conditions as $condition) {
        if ($condition instanceof ContextAwarePluginInterface) {
          try {
            if (empty($provided)) {
              $contexts = $this->contextRepository->getRuntimeContexts(array_values($condition->getContextMapping()));
            }
            else {
              $contexts = $provided;
            }
            $this->contextHandler->applyContextMapping($condition, $contexts);
          }
          catch (ContextException $e) {
            return FALSE;
          }
        }
      }
  
      return TRUE;
    }
code: protected function applyContexts(ConditionPluginCollection &$conditions, array $provided = []) {
      foreach ($conditions as $condition) {
        if ($condition instanceof ContextAwarePluginInterface) {
          try {
            if (empty($provided)) {
              $contexts = $this->contextRepository->getRuntimeContexts(array_values($condition->getContextMapping()));
            }
            else {
              $contexts = $provided;
            }
            $this->contextHandler->applyContextMapping($condition, $contexts);
          }
          catch (ContextException $e) {
            return FALSE;
          }
        }
      }
  
      return TRUE;
    }
code_tokens: protected function applyContexts ( ConditionPluginCollection & $ conditions , array $ provided = [ ] ) { foreach ( $ conditions as $ condition ) { if ( $ condition instanceof ContextAwarePluginInterface ) { try { if ( empty ( $ provided ) ) { $ contexts = $ this -> contextRepository -> getRuntimeContexts ( array_values ( $ condition -> getContextMapping ( ) ) ) ; } else { $ contexts = $ provided ; } $ this -> contextHandler -> applyContextMapping ( $ condition , $ contexts ) ; } catch ( ContextException $ e ) { return FALSE ; } } } return TRUE ; }
docstring: Apply context to all the context aware conditions in the collection.
  
  @param \Drupal\Core\Condition\ConditionPluginCollection $conditions
  A collection of conditions to apply context to.
  @param \Drupal\Core\Plugin\Context\Context[] $provided
  Additional provided (core) contexts to apply to Conditions.
  
  @return bool
  TRUE if conditions pass
docstring_tokens: Apply context to all the context aware conditions in the collection .