jenkins-bot has submitted this change and it was merged. Change subject: Removed ValueParsers Error interface ......................................................................
Removed ValueParsers Error interface Change-Id: Ic3e8180aba9ced293bca4102ebd0c82d045771f3 --- M ValueParsers/ValueParsers.classes.php M ValueParsers/ValueParsers.mw.php D ValueParsers/includes/Error.php D ValueParsers/tests/includes/ErrorTest.php 4 files changed, 0 insertions(+), 188 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/ValueParsers/ValueParsers.classes.php b/ValueParsers/ValueParsers.classes.php index 641d1d5..faf9ff2 100644 --- a/ValueParsers/ValueParsers.classes.php +++ b/ValueParsers/ValueParsers.classes.php @@ -27,9 +27,7 @@ * @author Jeroen De Dauw < [email protected] > */ return array( - 'ValueParsers\Error' => 'includes/Error.php', 'ValueParsers\ParseException' => 'includes/ParseException.php', - 'ValueParsers\ErrorObject' => 'includes/Error.php', 'ValueParsers\ParserOptions' => 'includes/ParserOptions.php', 'ValueParsers\ValueParser' => 'includes/ValueParser.php', 'ValueParsers\ValueParserFactory' => 'includes/ValueParserFactory.php', diff --git a/ValueParsers/ValueParsers.mw.php b/ValueParsers/ValueParsers.mw.php index ecbcab4..4f89c8d 100644 --- a/ValueParsers/ValueParsers.mw.php +++ b/ValueParsers/ValueParsers.mw.php @@ -79,7 +79,6 @@ 'includes/parsers/IntParser', 'includes/parsers/NullParser', - 'includes/Error', 'includes/ParserOptions', 'includes/ValueParserFactory', ); diff --git a/ValueParsers/includes/Error.php b/ValueParsers/includes/Error.php deleted file mode 100644 index 96e4c6e..0000000 --- a/ValueParsers/includes/Error.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -namespace ValueParsers; - -/** - * Interface for ValueParser errors. - * - * 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 - * - * @since 0.1 - * @deprecated - * - * @file - * @ingroup ValueParsers - * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw < [email protected] > - */ -class Error implements \Immutable { - - const SEVERITY_ERROR = 9; - const SEVERITY_WARNING = 4; - - protected $text; - protected $severity; - protected $property; - - /** - * Create a new error. - * - * @since 0.1 - * - * @param string $text - * @param string|null $property - * - * @return Error - */ - public static function newError( $text = '', $property = null ) { - return new static( $text, Error::SEVERITY_ERROR, $property ); - } - - /** - * @since 0.1 - * - * @param string $text - * @param integer $severity - * @param string|null $property - */ - protected function __construct( $text, $severity, $property ) { - $this->text = $text; - $this->severity = $severity; - $this->property = $property; - } - - /** - * Returns the error text. - * - * @since 0.1 - * - * @return string - */ - public function getText() { - return $this->text; - } - - /** - * Returns the severity of the error - * - * @since 0.1 - * - * @return integer, element of the ValueParserError::SEVERITY_ enum - */ - public function getSeverity() { - return $this->severity; - } - - /** - * Returns the property of the value for which the error occurred, or null if it occurred for the value itself. - * - * @since 0.1 - * - * @return string|null - */ - public function getProperty() { - return $this->property; - } - -} - -/** - * @deprecated - */ -class ErrorObject extends Error {} \ No newline at end of file diff --git a/ValueParsers/tests/includes/ErrorTest.php b/ValueParsers/tests/includes/ErrorTest.php deleted file mode 100644 index 9f1a7b7..0000000 --- a/ValueParsers/tests/includes/ErrorTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace ValueParsers\Test; - -use ValueParsers\Error; - -/** - * Unit tests for the ValueParsers\Error class. - * - * 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 - * - * @file - * @since 0.1 - * - * @ingroup ValueParsersTest - * - * @group ValueParsers - * @group DataValueExtensions - * - * @licence GNU GPL v2+ - * @author Jeroen De Dauw < [email protected] > - */ -class ErrorTest extends \MediaWikiTestCase { - - public function newErrorProvider() { - $argLists = array(); - - $argLists[] = array(); - - $argLists[] = array( '' ); - $argLists[] = array( 'foo' ); - $argLists[] = array( ' foo bar baz.' ); - - $argLists[] = array( ' foo bar ', null ); - $argLists[] = array( ' foo bar ', 'length' ); - - return $argLists; - } - - /** - * @dataProvider newErrorProvider - */ - public function testNewError() { - $args = func_get_args(); - - $error = call_user_func_array( 'ValueParsers\Error::newError', $args ); - - /** - * @var Error $error - */ - $this->assertInstanceOf( 'ValueParsers\Error', $error ); - - $this->assertInternalType( 'string', $error->getText() ); - $this->assertInternalType( 'integer', $error->getSeverity() ); - $this->assertTypeOrValue( 'string', $error->getProperty(), null ); - - if ( count( $args ) > 0 ) { - $this->assertEquals( $args[0], $error->getText() ); - } - - if ( count( $args ) > 1 ) { - $this->assertEquals( $args[1], $error->getProperty() ); - } - } - -} -- To view, visit https://gerrit.wikimedia.org/r/58879 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3e8180aba9ced293bca4102ebd0c82d045771f3 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <[email protected]> Gerrit-Reviewer: Anja Jentzsch <[email protected]> Gerrit-Reviewer: Ataherivand <[email protected]> Gerrit-Reviewer: Aude <[email protected]> Gerrit-Reviewer: Daniel Kinzler <[email protected]> Gerrit-Reviewer: Daniel Werner <[email protected]> Gerrit-Reviewer: Denny Vrandecic <[email protected]> Gerrit-Reviewer: Henning Snater <[email protected]> Gerrit-Reviewer: Jens Ohlig <[email protected]> Gerrit-Reviewer: Jeroen De Dauw <[email protected]> Gerrit-Reviewer: John Erling Blad <[email protected]> Gerrit-Reviewer: Lydia Pintscher <[email protected]> Gerrit-Reviewer: Markus Kroetzsch <[email protected]> Gerrit-Reviewer: Nikola Smolenski <[email protected]> Gerrit-Reviewer: Silke Meyer <[email protected]> Gerrit-Reviewer: Tobias Gritschacher <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
