jenkins-bot has submitted this change and it was merged. Change subject: Fix typo in exception and clean style in DataFieldValidator ......................................................................
Fix typo in exception and clean style in DataFieldValidator Change-Id: Ia8ea554d4dddd18f556507e76ea80fc5385d7840 --- M lib/includes/Validators/DataFieldValidator.php 1 file changed, 7 insertions(+), 32 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/includes/Validators/DataFieldValidator.php b/lib/includes/Validators/DataFieldValidator.php index 7aded7a..ed825aa 100644 --- a/lib/includes/Validators/DataFieldValidator.php +++ b/lib/includes/Validators/DataFieldValidator.php @@ -1,32 +1,5 @@ <?php - /** - * - * Copyright © 10.06.13 by the authors listed below. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @license GPL 2+ - * @file - * - * @author Daniel Kinzler - */ - - namespace Wikibase\Validators; - use DataValues\DataValue; use DataValues\IllegalValueException; @@ -40,7 +13,8 @@ * * @since 0.4 * - * @package Wikibase\Validators + * @license GPL 2+ + * @author Daniel Kinzler */ class DataFieldValidator implements ValueValidator { @@ -58,11 +32,11 @@ * @param string|int $field The field on the target DataValue's array representation to check * @param ValueValidator $validator The validator to apply to the given field * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public function __construct( $field, ValueValidator $validator ) { if ( !is_string( $field ) && !is_int( $field ) ) { - throw new InvalidArgumentException( '$field need to be a stringor int' ); + throw new InvalidArgumentException( '$field need to be a string or int' ); } $this->field = $field; @@ -87,7 +61,8 @@ if ( !array_key_exists( $this->field, $data ) ) { //XXX: or should this just be reported as invalid? - throw new InvalidArgumentException( "DataValue's array representation does not contain the field " . $this->field ); + throw new InvalidArgumentException( "DataValue's array representation does not " + . "contain the field " . $this->field ); } $fieldValue = $data[$this->field]; @@ -106,4 +81,4 @@ public function setOptions( array $options ) { // Do nothing. This method shouldn't even be in the interface. } -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/84960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8ea554d4dddd18f556507e76ea80fc5385d7840 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits