Skip to content

Instantly share code, notes, and snippets.

@filbertkm
Created January 20, 2016 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filbertkm/fe0458fafb2ceb42c63f to your computer and use it in GitHub Desktop.
Save filbertkm/fe0458fafb2ceb42c63f to your computer and use it in GitHub Desktop.
/**
* Constructor
* @param IContextSource $context IContextSource to inherit from
*/
public function __construct( IContextSource $context ) {
if ( ! ( $context instanceof MutableContext ) ) {
$context = $this->getMutableContextFromIContextSource( $context );
}
// Clone the original context object so we can change it without changing the
// source context one.
$context = clone $context;
// set this cloned context object as the context of this DerivativeContext instance,
// so any set*-call will be done on this one, like any get*-call
$this->setContext( $context );
}
/**
* @deprecated since 1.27 blah blah blah
* @returns MutableContext
*/
private function getMutableContextFromIContextSource( IContextSource $context ) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment