composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Drupal\Component\Plugin;
|
||||
|
||||
use Drupal\Component\Plugin\Context\ContextInterface;
|
||||
use Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface;
|
||||
use Drupal\Component\Plugin\Exception\ContextException;
|
||||
use Drupal\Component\Plugin\Context\Context;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
|
@ -67,7 +68,12 @@ abstract class ContextAwarePluginBase extends PluginBase implements ContextAware
|
|||
*/
|
||||
public function getContextDefinitions() {
|
||||
$definition = $this->getPluginDefinition();
|
||||
return !empty($definition['context']) ? $definition['context'] : [];
|
||||
if ($definition instanceof ContextAwarePluginDefinitionInterface) {
|
||||
return $definition->getContextDefinitions();
|
||||
}
|
||||
else {
|
||||
return !empty($definition['context']) ? $definition['context'] : [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,10 +81,15 @@ abstract class ContextAwarePluginBase extends PluginBase implements ContextAware
|
|||
*/
|
||||
public function getContextDefinition($name) {
|
||||
$definition = $this->getPluginDefinition();
|
||||
if (empty($definition['context'][$name])) {
|
||||
throw new ContextException(sprintf("The %s context is not a valid context.", $name));
|
||||
if ($definition instanceof ContextAwarePluginDefinitionInterface) {
|
||||
if ($definition->hasContextDefinition($name)) {
|
||||
return $definition->getContextDefinition($name);
|
||||
}
|
||||
}
|
||||
return $definition['context'][$name];
|
||||
elseif (!empty($definition['context'][$name])) {
|
||||
return $definition['context'][$name];
|
||||
}
|
||||
throw new ContextException(sprintf("The %s context is not a valid context.", $name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue