Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Plugin / Context / ContextProviderInterface.php
index 77075e8ce91f9ef7809c806666af942fbd17df88..3083bc964c832aa37ca0c620bd59fef10b4f7ae0 100644 (file)
@@ -27,7 +27,7 @@ interface ContextProviderInterface {
    *   $node = ...
    *
    *   // Set that specific node as the value of the 'node' context.
-   *   $context = new Context(new ContextDefinition('entity:node'), $node);
+   *   $context = EntityContext::fromEntity($node);
    *   return ['node' => $context];
    * @endcode
    *
@@ -62,7 +62,7 @@ interface ContextProviderInterface {
    *   // can be configured to use it. When the plugin, for example a block,
    *   // needs to evaluate the context, the value of this context will be
    *   // supplied by getRuntimeContexts().
-   *   $context = new Context(new ContextDefinition('entity:node'));
+   *   $context = EntityContext::fromEntityTypeId('node');
    *   return ['node' => $context];
    * @endcode
    *