Last modified: 2011-06-06 16:45:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29716, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27716 - Make a method to do checking of 0 or 1 of the parameters existence (like requireOnlyOneParameter), but without needing one of the parameters
Make a method to do checking of 0 or 1 of the parameters existence (like requ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-25 19:16 UTC by Sam Reed (reedy)
Modified: 2011-06-06 16:45 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2011-02-25 19:16:35 UTC
Make a method to do checking of 0 or 1 of the parameters existence (like requireOnlyOneParameter), but without needing one of the parameters

More a personal TODO. Hence crappy title

If someone can think of a nice method name, it'd be appreciated ;)
Comment 1 Sam Reed (reedy) 2011-03-19 23:34:45 UTC
I'm trying to remember my use case for this one now.

HMMMMM
Comment 2 Sam Reed (reedy) 2011-03-19 23:38:52 UTC
OH

		if ( isset( $params['users'] ) && isset( $params['ip'] ) ) {
			$this->dieUsage( 'bkusers and bkip cannot be used together', 'usersandip' );
		}


vs requireOnlyOneParameter

		if ( count( $intersection ) > 1 ) {
			$this->dieUsage( 'The parameters ' . implode( ', ', $intersection ) . ' can not be used together', 'invalidparammix' );
		} elseif ( count( $intersection ) == 0 ) {
			$this->dieUsage( 'One of the parameters ' . implode( ', ', $required ) . ' is required', 'missingparam' );
		}


Something like that without the == 0 check/error it seeeems...
Comment 3 Sam Reed (reedy) 2011-06-06 16:45:47 UTC
r89581

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links