Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/56781
Change subject: Fix ParserParameter names/class ...................................................................... Fix ParserParameter names/class This won't change any inherent logic but it makes naming more consistent and prepares for [1] in 1.10 [1] https://gerrit.wikimedia.org/r/#/c/52598 Change-Id: I03da66fc99f2bd1962d9eb8d93119ac70f3deccd --- M includes/Setup.php R includes/parserhooks/ParserParameterFormatter.php M includes/parserhooks/RecurringEventsParserFunction.php M includes/parserhooks/SetParserFunction.php M includes/parserhooks/SubobjectParserFunction.php R tests/phpunit/includes/parserhooks/ParserParameterFormatterTest.php M tests/phpunit/includes/parserhooks/RecurringEventsTest.php M tests/phpunit/includes/parserhooks/SubobjectHandlerTest.php 8 files changed, 16 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/81/56781/1 diff --git a/includes/Setup.php b/includes/Setup.php index 3e6020a..5817016 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -207,7 +207,7 @@ $wgAutoloadClasses['SMWConcept'] = $phDir . 'ConceptParserFunction.php'; $wgAutoloadClasses['SMWDeclare'] = $phDir . 'SMW_Declare.php'; $wgAutoloadClasses['SMWSMWDoc'] = $phDir . 'SMW_SMWDoc.php'; - $wgAutoloadClasses['SMW\ParserParameter'] = $phDir . 'ParserParameter.php'; + $wgAutoloadClasses['SMW\ParserParameterFormatter'] = $phDir . 'ParserParameterFormatter.php'; $wgAutoloadClasses['SMW\SetParser'] = $phDir . 'SetParserFunction.php'; $wgAutoloadClasses['SMW\SubobjectHandler'] = $phDir . 'SubobjectParserFunction.php'; $wgAutoloadClasses['SMW\Subobject'] = $phDir . 'Subobject.php'; diff --git a/includes/parserhooks/ParserParameter.php b/includes/parserhooks/ParserParameterFormatter.php similarity index 98% rename from includes/parserhooks/ParserParameter.php rename to includes/parserhooks/ParserParameterFormatter.php index 34bcbec..77c1fee 100644 --- a/includes/parserhooks/ParserParameter.php +++ b/includes/parserhooks/ParserParameterFormatter.php @@ -27,7 +27,7 @@ * @licence GNU GPL v2+ * @author mwjames */ -class ParserParameter { +class ParserParameterFormatter { /** * Returns a default separator diff --git a/includes/parserhooks/RecurringEventsParserFunction.php b/includes/parserhooks/RecurringEventsParserFunction.php index 78280b7..f4a86e8 100644 --- a/includes/parserhooks/RecurringEventsParserFunction.php +++ b/includes/parserhooks/RecurringEventsParserFunction.php @@ -50,7 +50,7 @@ $subject = $mainSemanticData->getSubject(); // FIXME Use a class instance - $parameters = ParserParameter::singleton()->getParameters( $params ); + $parameters = ParserParameterFormatter::singleton()->getParameters( $params ); // Get recurring events $events = new RecurringEvents( $parameters ); diff --git a/includes/parserhooks/SetParserFunction.php b/includes/parserhooks/SetParserFunction.php index 5fe1f04..a0dafa4 100644 --- a/includes/parserhooks/SetParserFunction.php +++ b/includes/parserhooks/SetParserFunction.php @@ -47,7 +47,7 @@ $params = func_get_args(); array_shift( $params ); - foreach ( ParserParameter::singleton()->getParameters( $params ) as $property => $values ){ + foreach ( ParserParameterFormatter::singleton()->getParameters( $params ) as $property => $values ){ foreach ( $values as $value ) { SMWParseData::addProperty( $property, $value, false, $parser, true ); } diff --git a/includes/parserhooks/SubobjectParserFunction.php b/includes/parserhooks/SubobjectParserFunction.php index 2c95317..1b5459c 100644 --- a/includes/parserhooks/SubobjectParserFunction.php +++ b/includes/parserhooks/SubobjectParserFunction.php @@ -115,7 +115,7 @@ $name = str_replace( ' ', '_', trim( array_shift( $params ) ) ); // FIXME Use a class instance here - $parameters = ParserParameter::singleton()->getParameters( $params ); + $parameters = ParserParameterFormatter::singleton()->getParameters( $params ); // Create handler instance and encapsulate the subobject instance by // returning a value object diff --git a/tests/phpunit/includes/parserhooks/ParserParameterTest.php b/tests/phpunit/includes/parserhooks/ParserParameterFormatterTest.php similarity index 88% rename from tests/phpunit/includes/parserhooks/ParserParameterTest.php rename to tests/phpunit/includes/parserhooks/ParserParameterFormatterTest.php index 3fc1e8b..edd4353 100644 --- a/tests/phpunit/includes/parserhooks/ParserParameterTest.php +++ b/tests/phpunit/includes/parserhooks/ParserParameterFormatterTest.php @@ -1,10 +1,10 @@ <?php namespace SMW\Test; -use SMW\ParserParameter; +use SMW\ParserParameterFormatter; /** - * Tests for the SMW\ParserParameter class. + * Tests for the SMW\ParserParameterFormatter 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 @@ -33,13 +33,13 @@ * @licence GNU GPL v2+ * @author mwjames */ -class ParserParameterTest extends \MediaWikiTestCase { +class ParserParameterFormatterTest extends \MediaWikiTestCase { public function testSingleton() { - $instance = ParserParameter::singleton(); + $instance = ParserParameterFormatter::singleton(); - $this->assertInstanceOf( 'SMW\ParserParameter', $instance ); - $this->assertTrue( ParserParameter::singleton() === $instance ); + $this->assertInstanceOf( 'SMW\ParserParameterFormatter', $instance ); + $this->assertTrue( ParserParameterFormatter::singleton() === $instance ); } public function getParametersDataProvider() { @@ -108,7 +108,7 @@ * @dataProvider getParametersDataProvider */ public function testGetParameters( array $params, array $expected ) { - $results = ParserParameter::singleton()->getParameters( $params ); + $results = ParserParameterFormatter::singleton()->getParameters( $params ); $this->assertTrue( is_array( $results ) ); $this->assertEquals( $results, $expected ); diff --git a/tests/phpunit/includes/parserhooks/RecurringEventsTest.php b/tests/phpunit/includes/parserhooks/RecurringEventsTest.php index c6bab46..d1e88ce 100644 --- a/tests/phpunit/includes/parserhooks/RecurringEventsTest.php +++ b/tests/phpunit/includes/parserhooks/RecurringEventsTest.php @@ -3,7 +3,7 @@ namespace SMW\Test; use SMW\RecurringEvents; -use SMW\ParserParameter; +use SMW\ParserParameterFormatter; /** * Tests for the SMW\RecurringEvents class. @@ -114,7 +114,7 @@ */ private function getInstance( array $params ) { // FIXME Class instance - $parameters = ParserParameter::singleton()->getParameters( $params ); + $parameters = ParserParameterFormatter::singleton()->getParameters( $params ); $instance = new RecurringEvents( $parameters ); return $instance; } diff --git a/tests/phpunit/includes/parserhooks/SubobjectHandlerTest.php b/tests/phpunit/includes/parserhooks/SubobjectHandlerTest.php index ef2acac..ce935e2 100644 --- a/tests/phpunit/includes/parserhooks/SubobjectHandlerTest.php +++ b/tests/phpunit/includes/parserhooks/SubobjectHandlerTest.php @@ -4,7 +4,7 @@ use SMW\SubobjectHandler; use SMW\Subobject; -use SMW\ParserParameter; +use SMW\ParserParameterFormatter; use SMWDIWikiPage; use Title; @@ -72,7 +72,7 @@ $subject = $this->getSubject( $DBKey ); // FIXME Class instance - $parameters = ParserParameter::singleton()->getParameters( $params ); + $parameters = ParserParameterFormatter::singleton()->getParameters( $params ); $instance = new SubobjectHandler( $subject, $parameters ); return $instance; } -- To view, visit https://gerrit.wikimedia.org/r/56781 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03da66fc99f2bd1962d9eb8d93119ac70f3deccd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Mwjames <jamesin.hongkon...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits