diff options
author | Daniel Friesen <dantman@users.mediawiki.org> | 2011-09-15 15:19:49 +0000 |
---|---|---|
committer | Daniel Friesen <dantman@users.mediawiki.org> | 2011-09-15 15:19:49 +0000 |
commit | 391736c0812b301beefe05f96c4c937996b7ba40 (patch) | |
tree | 9a3b66870808f61846bffe130f913f6d93f3e27e /includes/HTMLForm.php | |
parent | fcb0de554f61e3905430c181c0ddd767bcacebce (diff) | |
download | mediawikicore-391736c0812b301beefe05f96c4c937996b7ba40.tar.gz mediawikicore-391736c0812b301beefe05f96c4c937996b7ba40.zip |
Use IContextSource instead of RequestContext inside type hints and instanceof checks. All we need is something that implements IContextSource and it's possible we may want to implement types of RequestContext that don't directly extend RequestContext but are perfectly valid to be passed to classes.
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/97159
Diffstat (limited to 'includes/HTMLForm.php')
-rw-r--r-- | includes/HTMLForm.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index da84fc30e235..c8279bcf03c6 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -102,7 +102,7 @@ class HTMLForm { protected $mSubmitText; protected $mSubmitTooltip; - protected $mContext; // <! RequestContext + protected $mContext; // <! IContextSource protected $mTitle; protected $mMethod = 'post'; @@ -115,12 +115,12 @@ class HTMLForm { /** * Build a new HTMLForm from an array of field attributes * @param $descriptor Array of Field constructs, as described above - * @param $context RequestContext available since 1.18, will become compulsory in 1.18. + * @param $context IContextSource available since 1.18, will become compulsory in 1.18. * Obviates the need to call $form->setTitle() * @param $messagePrefix String a prefix to go in front of default messages */ - public function __construct( $descriptor, /*RequestContext*/ $context = null, $messagePrefix = '' ) { - if( $context instanceof RequestContext ){ + public function __construct( $descriptor, /*IContextSource*/ $context = null, $messagePrefix = '' ) { + if( $context instanceof IContextSource ){ $this->mContext = $context; $this->mTitle = false; // We don't need them to set a title $this->mMessagePrefix = $messagePrefix; @@ -638,10 +638,10 @@ class HTMLForm { } /** - * @return RequestContext + * @return IContextSource */ public function getContext(){ - return $this->mContext instanceof RequestContext + return $this->mContext instanceof IContextSource ? $this->mContext : RequestContext::getMain(); } |