The parameter passed to the execute() method of each special page can
be null, and usually is. In some of these files this fact was already
mentioned in the comment, but not listed as a type.
In this patch I also remove comments that do not explain much. Saying
that the execute() method of a special page "executes a special page" or
is the "main entry point to a special page" is not super helpful. That's
usually what the documentation in the parent class shoudl explain.
We can add @inheritDoc tags in all these cases if you prefer. Please
tell me.
Change-Id: I1d811ab0c6d5c956e36f6a74120a425abc4332e6
14 files changed:
- * Main execution point
- *
- * @param string $subpage
+ * @param string|null $subpage
*/
public function execute( $subpage ) {
$this->rcSubpage = $subpage;
*/
public function execute( $subpage ) {
$this->rcSubpage = $subpage;
abstract class FormSpecialPage extends SpecialPage {
/**
* The sub-page of the special page.
abstract class FormSpecialPage extends SpecialPage {
/**
* The sub-page of the special page.
*/
protected $par = null;
*/
protected $par = null;
/**
* Basic SpecialPage workflow: get a form, send it to the user; get some data back,
*
/**
* Basic SpecialPage workflow: get a form, send it to the user; get some data back,
*
- * @param string $par Subpage string if one was specified
+ * @param string|null $par Subpage string if one was specified
*/
public function execute( $par ) {
$this->setParameter( $par );
*/
public function execute( $par ) {
$this->setParameter( $par );
/**
* Maybe do something interesting with the subpage parameter
/**
* Maybe do something interesting with the subpage parameter
+ * @param string|null $par
*/
protected function setParameter( $par ) {
$this->par = $par;
*/
protected function setParameter( $par ) {
$this->par = $par;
/**
* This is the actual workhorse. It does everything needed to make a
* real, honest-to-gosh query page.
/**
* This is the actual workhorse. It does everything needed to make a
* real, honest-to-gosh query page.
+ * @param string|null $par
*/
public function execute( $par ) {
$user = $this->getUser();
*/
public function execute( $par ) {
$user = $this->getUser();
- * Show the special page
- *
- * @param string $par Parameter passed to the page or null
+ * @param string|null $par Parameter passed to the page or null
*/
public function execute( $par ) {
$out = $this->getOutput();
*/
public function execute( $par ) {
$out = $this->getOutput();
- * Show the special page
- *
- * @param string $par Parameter passed to the page or null
+ * @param string|null $par Parameter passed to the page or null
*/
public function execute( $par ) {
$out = $this->getOutput();
*/
public function execute( $par ) {
$out = $this->getOutput();
- * Main execution point
- *
- * @param string $par Title fragment
+ * @param string|null $par Title fragment
*/
public function execute( $par ) {
$this->setHeaders();
*/
public function execute( $par ) {
$this->setHeaders();
- * Main execution point
- *
- * @param string $par Title fragment
+ * @param string|null $par Title fragment
*/
public function execute( $par ) {
$this->setHeaders();
*/
public function execute( $par ) {
$this->setHeaders();
- * Show the special page
- *
- * @param string $isbn ISBN passed as a subpage parameter
+ * @param string|null $isbn ISBN passed as a subpage parameter
*/
public function execute( $isbn ) {
$out = $this->getOutput();
*/
public function execute( $isbn ) {
$out = $this->getOutput();
/**
* Show a form for filtering namespace and username
*
/**
* Show a form for filtering namespace and username
*
+ * @param string|null $par
* @return string
*/
public function execute( $par ) {
* @return string
*/
public function execute( $par ) {
- * Show the special page
- *
- * @param string $par (optional) A group to list users from
+ * @param string|null $par (optional) A group to list users from
*/
public function execute( $par ) {
$this->setHeaders();
*/
public function execute( $par ) {
$this->setHeaders();
parent::__construct( 'Newpages' );
}
parent::__construct( 'Newpages' );
}
+ /**
+ * @param string|null $par
+ */
protected function setup( $par ) {
$opts = new FormOptions();
$this->opts = $opts; // bind
protected function setup( $par ) {
$opts = new FormOptions();
$this->opts = $opts; // bind
$opts->validateIntBounds( 'limit', 0, 5000 );
}
$opts->validateIntBounds( 'limit', 0, 5000 );
}
+ /**
+ * @param string $par
+ */
protected function parseParams( $par ) {
$bits = preg_split( '/\s*,\s*/', trim( $par ) );
foreach ( $bits as $bit ) {
protected function parseParams( $par ) {
$bits = preg_split( '/\s*,\s*/', trim( $par ) );
foreach ( $bits as $bit ) {
/**
* Show a form for filtering namespace and username
*
/**
* Show a form for filtering namespace and username
*
+ * @param string|null $par
*/
public function execute( $par ) {
$out = $this->getOutput();
*/
public function execute( $par ) {
$out = $this->getOutput();
- * Main execution point
- *
- * @param string $subpage
+ * @param string|null $subpage
*/
public function execute( $subpage ) {
// Backwards-compatibility: redirect to new feed URLs
*/
public function execute( $subpage ) {
// Backwards-compatibility: redirect to new feed URLs
- * Special page entry point
- * @param string $par
+ * @param string|null $par
* @throws ErrorPageError
* @throws Exception
* @throws FatalError
* @throws ErrorPageError
* @throws Exception
* @throws FatalError
/**
* Execute page -- can output a file directly or show a listing of them.
*
/**
* Execute page -- can output a file directly or show a listing of them.
*
- * @param string $subPage Subpage, e.g. in
+ * @param string|null $subPage Subpage, e.g. in
* https://example.com/wiki/Special:UploadStash/foo.jpg, the "foo.jpg" part
* @return bool Success
*/
* https://example.com/wiki/Special:UploadStash/foo.jpg, the "foo.jpg" part
* @return bool Success
*/