* $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
*
* // 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
*