Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/184024
Change subject: MWException -> Exception ...................................................................... MWException -> Exception Change-Id: Iad0969e04d191aa2846a66a98c8e7aac314a4a6a --- M includes/FormatFactory.php M includes/Highlighter.php M includes/SemanticData.php M includes/dataitems/SMW_DI_String.php M includes/exceptions/DataItemException.php M includes/exceptions/InvalidNamespaceException.php M includes/exceptions/InvalidPredefinedPropertyException.php M includes/exceptions/InvalidPropertyException.php M includes/exceptions/InvalidResultException.php M includes/exceptions/InvalidSemanticDataException.php M includes/exceptions/InvalidSettingsArgumentException.php M includes/exceptions/InvalidStoreException.php M includes/exceptions/UnknownIdException.php M includes/export/SMW_Exp_Element.php M includes/formatters/ParserParameterFormatter.php M includes/interfaces/Observable.php M includes/interfaces/Observer.php M includes/interfaces/ResultCollector.php M includes/query/SMW_QueryProcessor.php M includes/queryprinters/ExportPrinter.php M includes/queryprinters/FeedResultPrinter.php M includes/src/MediaWiki/Jobs/RefreshJob.php M includes/src/PageInfo.php M includes/src/Query/Profiler/DescriptionProfile.php M includes/src/Query/Profiler/DurationProfile.php M includes/src/Query/Profiler/FormatProfile.php M includes/src/Query/Profiler/NullProfile.php M includes/src/Reporter/MessageReporter.php M includes/src/SPARQLStore/QueryEngine/Condition/FalseCondition.php M includes/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php M includes/src/SPARQLStore/QueryEngine/ConditionBuilder/ConditionBuilder.php M includes/storage/PropertyStatisticsStore.php M includes/storage/SMW_RequestOptions.php M includes/storage/SQLStore/PropertyStatisticsTable.php M includes/storage/SQLStore/SMW_DataItemHandler.php M includes/storage/SQLStore/SMW_SQLStore3.php M includes/storage/SQLStore/SMW_SQLStore3_Queries.php M includes/storage/SQLStore/SMW_Sql3SmwIds.php M includes/storage/SQLStore/SimplePropertyStatisticsRebuilder.php M includes/storage/StringCondition.php M languages/SMW_Aliases.php M languages/SMW_Magic.php M languages/SemanticMediaWiki.namespaces.php M maintenance/SMW_dumpRDF.php M maintenance/SMW_setup.php M tests/phpunit/Integration/MediaWiki/Import/Maintenance/RebuildPropertyStatisticsMaintenanceTest.php M tests/phpunit/Utils/Runners/XmlImportRunner.php M tests/phpunit/Utils/Validators/SemanticDataValidator.php M tests/phpunit/includes/DefinesTest.php M tests/phpunit/includes/FormatFactoryTest.php M tests/phpunit/includes/GlobalFunctionsTest.php M tests/phpunit/includes/Maintenance/DataRebuilderTest.php M tests/phpunit/includes/RecurringEventsTest.php M tests/phpunit/includes/Reporter/MessageReporterTestCase.php M tests/phpunit/includes/SemanticDataTest.php M tests/phpunit/includes/dataitems/DIConceptTest.php M tests/phpunit/includes/dataitems/DI_GeoCoordTest.php M tests/phpunit/includes/dataitems/DI_NumberTest.php M tests/phpunit/includes/dataitems/DataItemTest.php M tests/phpunit/includes/dic/SimpleDependencyBuilderTest.php M tests/phpunit/includes/export/SMWExpElementTest.php M tests/phpunit/includes/storage/sqlstore/PropertyStatisticsTableTest.php 62 files changed, 108 insertions(+), 108 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/24/184024/1 diff --git a/includes/FormatFactory.php b/includes/FormatFactory.php index ea459f1..ac822d8 100644 --- a/includes/FormatFactory.php +++ b/includes/FormatFactory.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Factory for "result formats", ie classes implementing QueryResultPrinter. @@ -76,15 +76,15 @@ * @param string $formatName * @param string $class * - * @throws MWException + * @throws Exception */ public function registerFormat( $formatName, $class ) { if ( !is_string( $formatName ) ) { - throw new MWException( 'Format names can only be of type string' ); + throw new Exception( 'Format names can only be of type string' ); } if ( !is_string( $class ) ) { - throw new MWException( 'Format class names can only be of type string' ); + throw new Exception( 'Format class names can only be of type string' ); } $this->formats[$formatName] = $class; @@ -100,16 +100,16 @@ * @param string $formatName * @param array $aliases * - * @throws MWException + * @throws Exception */ public function registerAliases( $formatName, array $aliases ) { if ( !is_string( $formatName ) ) { - throw new MWException( 'Format names can only be of type string' ); + throw new Exception( 'Format names can only be of type string' ); } foreach ( $aliases as $alias ) { if ( !is_string( $alias ) ) { - throw new MWException( 'Format aliases can only be of type string' ); + throw new Exception( 'Format aliases can only be of type string' ); } $this->aliases[$alias] = $formatName; @@ -163,13 +163,13 @@ * @param string $formatName Format name or alias * * @return string - * @throws MWException + * @throws Exception */ protected function getPrinterClass( $formatName ) { $formatName = $this->getCanonicalName( $formatName ); if ( !array_key_exists( $formatName, $this->formats ) ) { - throw new MWException( 'Unknown format name "' . $formatName . '" has no associated printer class' ); + throw new Exception( 'Unknown format name "' . $formatName . '" has no associated printer class' ); } return $this->formats[$formatName]; @@ -183,11 +183,11 @@ * @param string $formatName Format name or alias * * @return string - * @throws MWException + * @throws Exception */ public function getCanonicalName( $formatName ) { if ( !is_string( $formatName ) ) { - throw new MWException( 'Format names can only be of type string' ); + throw new Exception( 'Format names can only be of type string' ); } if ( array_key_exists( $formatName, $this->aliases ) ) { diff --git a/includes/Highlighter.php b/includes/Highlighter.php index 9a8aa69..1c73460 100644 --- a/includes/Highlighter.php +++ b/includes/Highlighter.php @@ -8,7 +8,7 @@ use ContextSource; use Html; -use MWException; +use Exception; /** * Highlighter utility function for Semantic MediaWiki diff --git a/includes/SemanticData.php b/includes/SemanticData.php index a43c686..7451c1a 100644 --- a/includes/SemanticData.php +++ b/includes/SemanticData.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; use SMWDataValue; use SMWDIContainer; use SMWDataItem; @@ -486,12 +486,12 @@ * * @param SemanticData $semanticData object to copy from * - * @throws MWException if subjects do not match + * @throws Exception if subjects do not match */ public function importDataFrom( SemanticData $semanticData ) { if( !$this->mSubject->equals( $semanticData->getSubject() ) ) { - throw new MWException( "SMWSemanticData can only represent data about one subject. Importing data for another subject is not possible." ); + throw new Exception( "SMWSemanticData can only represent data about one subject. Importing data for another subject is not possible." ); } // Shortcut when copying into empty objects that don't ask for @@ -598,18 +598,18 @@ * * @param SemanticData $semanticData * - * @throws MWException if not adding data about a subobject of this data + * @throws Exception if not adding data about a subobject of this data */ public function addSubSemanticData( SemanticData $semanticData ) { if ( !$this->subDataAllowed ) { - throw new MWException( "Cannot add subdata. Are you trying to add data to an SMWSemanticData object that is already used as a subdata object?" ); + throw new Exception( "Cannot add subdata. Are you trying to add data to an SMWSemanticData object that is already used as a subdata object?" ); } $subobjectName = $semanticData->getSubject()->getSubobjectName(); if ( $subobjectName == '' ) { - throw new MWException( "Cannot add data that is not about a subobject." ); + throw new Exception( "Cannot add data that is not about a subobject." ); } if( $semanticData->getSubject()->getDBkey() !== $this->getSubject()->getDBkey() ) { - throw new MWException( "Data for a subobject of {$semanticData->getSubject()->getDBkey()} cannot be added to {$this->getSubject()->getDBkey()}." ); + throw new Exception( "Data for a subobject of {$semanticData->getSubject()->getDBkey()} cannot be added to {$this->getSubject()->getDBkey()}." ); } if( $this->hasSubSemanticData( $subobjectName ) ) { diff --git a/includes/dataitems/SMW_DI_String.php b/includes/dataitems/SMW_DI_String.php index 9b5deec..828dd4c 100644 --- a/includes/dataitems/SMW_DI_String.php +++ b/includes/dataitems/SMW_DI_String.php @@ -5,7 +5,7 @@ * * @deprecated Will be removed after SMW 1.9; do not use */ -class SMWStringLengthException extends MWException { +class SMWStringLengthException extends Exception { } /** diff --git a/includes/exceptions/DataItemException.php b/includes/exceptions/DataItemException.php index 15669c5..bea534b 100644 --- a/includes/exceptions/DataItemException.php +++ b/includes/exceptions/DataItemException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * @codeCoverageIgnore @@ -15,4 +15,4 @@ * * @author Markus Krötzsch */ -class DataItemException extends MWException {} +class DataItemException extends Exception {} diff --git a/includes/exceptions/InvalidNamespaceException.php b/includes/exceptions/InvalidNamespaceException.php index 03d5c70..96dd1bb 100644 --- a/includes/exceptions/InvalidNamespaceException.php +++ b/includes/exceptions/InvalidNamespaceException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an invalid namespace @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidNamespaceException extends MWException {} \ No newline at end of file +class InvalidNamespaceException extends Exception {} diff --git a/includes/exceptions/InvalidPredefinedPropertyException.php b/includes/exceptions/InvalidPredefinedPropertyException.php index e549bd7..8971b77 100644 --- a/includes/exceptions/InvalidPredefinedPropertyException.php +++ b/includes/exceptions/InvalidPredefinedPropertyException.php @@ -18,4 +18,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidPredefinedPropertyException extends InvalidPropertyException {} \ No newline at end of file +class InvalidPredefinedPropertyException extends InvalidPropertyException {} diff --git a/includes/exceptions/InvalidPropertyException.php b/includes/exceptions/InvalidPropertyException.php index 47956c7..b7f2af4 100644 --- a/includes/exceptions/InvalidPropertyException.php +++ b/includes/exceptions/InvalidPropertyException.php @@ -18,4 +18,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidPropertyException extends DataItemException {} \ No newline at end of file +class InvalidPropertyException extends DataItemException {} diff --git a/includes/exceptions/InvalidResultException.php b/includes/exceptions/InvalidResultException.php index 2ed38e6..2cce8d8 100644 --- a/includes/exceptions/InvalidResultException.php +++ b/includes/exceptions/InvalidResultException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an invalid result object @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidResultException extends MWException {} \ No newline at end of file +class InvalidResultException extends Exception {} diff --git a/includes/exceptions/InvalidSemanticDataException.php b/includes/exceptions/InvalidSemanticDataException.php index b44c04d..46eeaa1 100644 --- a/includes/exceptions/InvalidSemanticDataException.php +++ b/includes/exceptions/InvalidSemanticDataException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an invalid semantic data object @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidSemanticDataException extends MWException {} \ No newline at end of file +class InvalidSemanticDataException extends Exception {} diff --git a/includes/exceptions/InvalidSettingsArgumentException.php b/includes/exceptions/InvalidSettingsArgumentException.php index e721c20..7886557 100644 --- a/includes/exceptions/InvalidSettingsArgumentException.php +++ b/includes/exceptions/InvalidSettingsArgumentException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an invalid settings argument @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidSettingsArgumentException extends MWException {} \ No newline at end of file +class InvalidSettingsArgumentException extends Exception {} diff --git a/includes/exceptions/InvalidStoreException.php b/includes/exceptions/InvalidStoreException.php index b851755..1fa07eb 100644 --- a/includes/exceptions/InvalidStoreException.php +++ b/includes/exceptions/InvalidStoreException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an invalid store instance @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class InvalidStoreException extends MWException {} \ No newline at end of file +class InvalidStoreException extends Exception {} diff --git a/includes/exceptions/UnknownIdException.php b/includes/exceptions/UnknownIdException.php index 49b202d..df9e262 100644 --- a/includes/exceptions/UnknownIdException.php +++ b/includes/exceptions/UnknownIdException.php @@ -2,7 +2,7 @@ namespace SMW; -use MWException; +use Exception; /** * Exception for an unknown Id @@ -20,4 +20,4 @@ * @ingroup Exception * @codeCoverageIgnore */ -class UnknownIdException extends MWException {} \ No newline at end of file +class UnknownIdException extends Exception {} diff --git a/includes/export/SMW_Exp_Element.php b/includes/export/SMW_Exp_Element.php index 57ebdd0..7195381 100644 --- a/includes/export/SMW_Exp_Element.php +++ b/includes/export/SMW_Exp_Element.php @@ -278,4 +278,4 @@ return $this->lexicalForm; } -} \ No newline at end of file +} diff --git a/includes/formatters/ParserParameterFormatter.php b/includes/formatters/ParserParameterFormatter.php index 4e51949..04b723b 100644 --- a/includes/formatters/ParserParameterFormatter.php +++ b/includes/formatters/ParserParameterFormatter.php @@ -170,4 +170,4 @@ return $results; } -} \ No newline at end of file +} diff --git a/includes/interfaces/Observable.php b/includes/interfaces/Observable.php index c09c176..6b8efa1 100644 --- a/includes/interfaces/Observable.php +++ b/includes/interfaces/Observable.php @@ -61,4 +61,4 @@ */ public function getSubject(); -} \ No newline at end of file +} diff --git a/includes/interfaces/Observer.php b/includes/interfaces/Observer.php index facb4c4..e43ad53 100644 --- a/includes/interfaces/Observer.php +++ b/includes/interfaces/Observer.php @@ -23,4 +23,4 @@ */ public function update( Observable $observable ); -} \ No newline at end of file +} diff --git a/includes/interfaces/ResultCollector.php b/includes/interfaces/ResultCollector.php index 718ed48..f36c25a 100644 --- a/includes/interfaces/ResultCollector.php +++ b/includes/interfaces/ResultCollector.php @@ -33,4 +33,4 @@ */ public function getResults(); -} \ No newline at end of file +} diff --git a/includes/query/SMW_QueryProcessor.php b/includes/query/SMW_QueryProcessor.php index 62fa18e..a66faa1 100644 --- a/includes/query/SMW_QueryProcessor.php +++ b/includes/query/SMW_QueryProcessor.php @@ -557,13 +557,13 @@ * @param $context * * @return SMWResultPrinter - * @throws MWException if no printer is known for the given format + * @throws Exception if no printer is known for the given format */ static public function getResultPrinter( $format, $context = self::SPECIAL_PAGE ) { global $smwgResultFormats; if ( !array_key_exists( $format, $smwgResultFormats ) ) { - throw new MWException( "There is no result format for '$format'." ); + throw new Exception( "There is no result format for '$format'." ); } $formatClass = $smwgResultFormats[$format]; diff --git a/includes/queryprinters/ExportPrinter.php b/includes/queryprinters/ExportPrinter.php index 2bfbd55..cf396c0 100644 --- a/includes/queryprinters/ExportPrinter.php +++ b/includes/queryprinters/ExportPrinter.php @@ -55,4 +55,4 @@ */ public function getFileName( SMWQueryResult $queryResult ); -} \ No newline at end of file +} diff --git a/includes/queryprinters/FeedResultPrinter.php b/includes/queryprinters/FeedResultPrinter.php index e8125cb..0776630 100644 --- a/includes/queryprinters/FeedResultPrinter.php +++ b/includes/queryprinters/FeedResultPrinter.php @@ -333,4 +333,4 @@ return $params; } -} \ No newline at end of file +} diff --git a/includes/src/MediaWiki/Jobs/RefreshJob.php b/includes/src/MediaWiki/Jobs/RefreshJob.php index 2f40962..a16ed1e 100644 --- a/includes/src/MediaWiki/Jobs/RefreshJob.php +++ b/includes/src/MediaWiki/Jobs/RefreshJob.php @@ -117,4 +117,4 @@ return ( ( $this->getParameter( 'rc' ) > 1 ) && ( $run == 1 ) ) ? array( SMW_NS_PROPERTY, SMW_NS_TYPE ) : false; } -} \ No newline at end of file +} diff --git a/includes/src/PageInfo.php b/includes/src/PageInfo.php index b81438e..3cb75e3 100644 --- a/includes/src/PageInfo.php +++ b/includes/src/PageInfo.php @@ -75,4 +75,4 @@ */ public function getMimeType(); -} \ No newline at end of file +} diff --git a/includes/src/Query/Profiler/DescriptionProfile.php b/includes/src/Query/Profiler/DescriptionProfile.php index c3c33c6..b78d52f 100644 --- a/includes/src/Query/Profiler/DescriptionProfile.php +++ b/includes/src/Query/Profiler/DescriptionProfile.php @@ -62,4 +62,4 @@ ); } -} \ No newline at end of file +} diff --git a/includes/src/Query/Profiler/DurationProfile.php b/includes/src/Query/Profiler/DurationProfile.php index c2220c4..5a77c36 100644 --- a/includes/src/Query/Profiler/DurationProfile.php +++ b/includes/src/Query/Profiler/DurationProfile.php @@ -45,4 +45,4 @@ ); } -} \ No newline at end of file +} diff --git a/includes/src/Query/Profiler/FormatProfile.php b/includes/src/Query/Profiler/FormatProfile.php index be7fd66..05d2461 100644 --- a/includes/src/Query/Profiler/FormatProfile.php +++ b/includes/src/Query/Profiler/FormatProfile.php @@ -43,4 +43,4 @@ ); } -} \ No newline at end of file +} diff --git a/includes/src/Query/Profiler/NullProfile.php b/includes/src/Query/Profiler/NullProfile.php index 5ee6ff7..fabda73 100644 --- a/includes/src/Query/Profiler/NullProfile.php +++ b/includes/src/Query/Profiler/NullProfile.php @@ -90,4 +90,4 @@ // ); } -} \ No newline at end of file +} diff --git a/includes/src/Reporter/MessageReporter.php b/includes/src/Reporter/MessageReporter.php index 45cccb0..d014cd6 100644 --- a/includes/src/Reporter/MessageReporter.php +++ b/includes/src/Reporter/MessageReporter.php @@ -23,4 +23,4 @@ */ public function reportMessage( $message ); -} \ No newline at end of file +} diff --git a/includes/src/SPARQLStore/QueryEngine/Condition/FalseCondition.php b/includes/src/SPARQLStore/QueryEngine/Condition/FalseCondition.php index 505a486..2446cd0 100644 --- a/includes/src/SPARQLStore/QueryEngine/Condition/FalseCondition.php +++ b/includes/src/SPARQLStore/QueryEngine/Condition/FalseCondition.php @@ -22,4 +22,4 @@ public function isSafe() { return true; } -} \ No newline at end of file +} diff --git a/includes/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php b/includes/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php index 0bf4613..07348ee 100644 --- a/includes/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php +++ b/includes/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php @@ -35,4 +35,4 @@ return false; } -} \ No newline at end of file +} diff --git a/includes/src/SPARQLStore/QueryEngine/ConditionBuilder/ConditionBuilder.php b/includes/src/SPARQLStore/QueryEngine/ConditionBuilder/ConditionBuilder.php index 6e37d2c..d1e69b1 100644 --- a/includes/src/SPARQLStore/QueryEngine/ConditionBuilder/ConditionBuilder.php +++ b/includes/src/SPARQLStore/QueryEngine/ConditionBuilder/ConditionBuilder.php @@ -41,4 +41,4 @@ */ public function buildCondition( Description $description, $joinVariable, $orderByProperty = null ); -} \ No newline at end of file +} diff --git a/includes/storage/PropertyStatisticsStore.php b/includes/storage/PropertyStatisticsStore.php index a37e33c..8655d78 100644 --- a/includes/storage/PropertyStatisticsStore.php +++ b/includes/storage/PropertyStatisticsStore.php @@ -92,4 +92,4 @@ */ public function deleteAll(); -} \ No newline at end of file +} diff --git a/includes/storage/SMW_RequestOptions.php b/includes/storage/SMW_RequestOptions.php index 616000a..e56e700 100644 --- a/includes/storage/SMW_RequestOptions.php +++ b/includes/storage/SMW_RequestOptions.php @@ -76,4 +76,4 @@ return $this->stringcond; } -} \ No newline at end of file +} diff --git a/includes/storage/SQLStore/PropertyStatisticsTable.php b/includes/storage/SQLStore/PropertyStatisticsTable.php index cdd04a1..7915f1b 100644 --- a/includes/storage/SQLStore/PropertyStatisticsTable.php +++ b/includes/storage/SQLStore/PropertyStatisticsTable.php @@ -5,7 +5,7 @@ use SMW\Store\PropertyStatisticsStore; use SMW\MediaWiki\Database; -use MWException; +use Exception; /** * Simple implementation of PropertyStatisticsTable using MediaWikis @@ -57,15 +57,15 @@ * @param integer $value * * @return boolean Success indicator - * @throws MWException + * @throws Exception */ public function addToUsageCount( $propertyId, $value ) { if ( !is_int( $value ) ) { - throw new MWException( 'The value to add must be an integer' ); + throw new Exception( 'The value to add must be an integer' ); } if ( !is_int( $propertyId ) || $propertyId <= 0 ) { - throw new MWException( 'The property id to add must be a positive integer' ); + throw new Exception( 'The property id to add must be a positive integer' ); } if ( $value == 0 ) { @@ -113,15 +113,15 @@ * @param integer $value * * @return boolean Success indicator - * @throws MWException + * @throws Exception */ public function setUsageCount( $propertyId, $value ) { if ( !is_int( $value ) || $value < 0 ) { - throw new MWException( 'The value to add must be a positive integer' ); + throw new Exception( 'The value to add must be a positive integer' ); } if ( !is_int( $propertyId ) || $propertyId <= 0 ) { - throw new MWException( 'The property id to add must be a positive integer' ); + throw new Exception( 'The property id to add must be a positive integer' ); } return $this->dbConnection->update( @@ -145,15 +145,15 @@ * @param integer $value * * @return boolean Success indicator - * @throws MWException + * @throws Exception */ public function insertUsageCount( $propertyId, $value ) { if ( !is_int( $value ) || $value < 0 ) { - throw new MWException( 'The value to add must be a positive integer' ); + throw new Exception( 'The value to add must be a positive integer' ); } if ( !is_int( $propertyId ) || $propertyId <= 0 ) { - throw new MWException( 'The property id to add must be a positive integer' ); + throw new Exception( 'The property id to add must be a positive integer' ); } return $this->dbConnection->insert( diff --git a/includes/storage/SQLStore/SMW_DataItemHandler.php b/includes/storage/SQLStore/SMW_DataItemHandler.php index a6899ee..7d5981a 100644 --- a/includes/storage/SQLStore/SMW_DataItemHandler.php +++ b/includes/storage/SQLStore/SMW_DataItemHandler.php @@ -145,4 +145,4 @@ */ abstract public function dataItemFromDBKeys( $dbkeys ); -} \ No newline at end of file +} diff --git a/includes/storage/SQLStore/SMW_SQLStore3.php b/includes/storage/SQLStore/SMW_SQLStore3.php index 4b7fd2f..b83eb33 100644 --- a/includes/storage/SQLStore/SMW_SQLStore3.php +++ b/includes/storage/SQLStore/SMW_SQLStore3.php @@ -207,7 +207,7 @@ * * @since 1.8 * @param integer $diType - * @throws MWException if no handler exists for the given type + * @throws Exception if no handler exists for the given type * @return SMWDataItemHandler */ public function getDataItemHandlerForDIType( $diType ) { @@ -238,13 +238,13 @@ $this->diHandlers[$diType] = new SMWDIHandlerConcept( $this ); break; case SMWDataItem::TYPE_PROPERTY: - throw new MWException( "There is no DI handler for SMWDataItem::TYPE_PROPERTY." ); + throw new Exception( "There is no DI handler for SMWDataItem::TYPE_PROPERTY." ); case SMWDataItem::TYPE_CONTAINER: - throw new MWException( "There is no DI handler for SMWDataItem::TYPE_CONTAINER." ); + throw new Exception( "There is no DI handler for SMWDataItem::TYPE_CONTAINER." ); case SMWDataItem::TYPE_ERROR: - throw new MWException( "There is no DI handler for SMWDataItem::TYPE_ERROR." ); + throw new Exception( "There is no DI handler for SMWDataItem::TYPE_ERROR." ); default: - throw new MWException( "The value \"$diType\" is not a valid dataitem ID." ); + throw new Exception( "The value \"$diType\" is not a valid dataitem ID." ); } } return $this->diHandlers[$diType]; @@ -255,7 +255,7 @@ * * @since 1.8 * @param string $typeid - * @throws MWException if there is no handler for this type + * @throws Exception if there is no handler for this type * @return SMWDataItemHandler */ public function getDataItemHandlerForDatatype( $typeid ) { diff --git a/includes/storage/SQLStore/SMW_SQLStore3_Queries.php b/includes/storage/SQLStore/SMW_SQLStore3_Queries.php index cb70fb4..ef9f425 100644 --- a/includes/storage/SQLStore/SMW_SQLStore3_Queries.php +++ b/includes/storage/SQLStore/SMW_SQLStore3_Queries.php @@ -831,7 +831,7 @@ } elseif ( $description instanceof SMWThingDescription ) { // nothing to do } else { - throw new MWException( "Cannot process this type of SMWDescription." ); + throw new Exception( "Cannot process this type of SMWDescription." ); } } @@ -895,13 +895,13 @@ $value = str_replace( array( '%', '_', '*', '?' ), array( '\%', '\_', '%', '_' ), $value ); break; default: - throw new MWException( "Unsupported comparator '" . $description->getComparator() . "' in query condition." ); + throw new Exception( "Unsupported comparator '" . $description->getComparator() . "' in query condition." ); } $where = "$query->alias.{$indexField}{$comparator}" . $this->m_dbs->addQuotes( $value ); } } else { // exact match (like comparator = above, but not using $valueField -throw new MWException("Debug -- this code might be dead."); +throw new Exception("Debug -- this code might be dead."); foreach ( $diHandler->getWhereConds( $dataItem ) as $fieldname => $value ) { $where .= ( $where ? ' AND ' : '' ) . "{$query->alias}.$fieldname=" . $this->m_dbs->addQuotes( $value ); } diff --git a/includes/storage/SQLStore/SMW_Sql3SmwIds.php b/includes/storage/SQLStore/SMW_Sql3SmwIds.php index c47ebf5..7b6d9ff 100644 --- a/includes/storage/SQLStore/SMW_Sql3SmwIds.php +++ b/includes/storage/SQLStore/SMW_Sql3SmwIds.php @@ -793,7 +793,7 @@ */ public function setCache( $title, $namespace, $interwiki, $subobject, $id, $sortkey ) { if ( strpos( $title, ' ' ) !== false ) { - throw new MWException("Somebody tried to use spaces in a cache title! ($title)"); + throw new Exception("Somebody tried to use spaces in a cache title! ($title)"); } $hashKey = HashBuilder::createHashIdFromSegments( $title, $namespace, $interwiki, $subobject ); @@ -1105,4 +1105,4 @@ return self::tableName; } -} \ No newline at end of file +} diff --git a/includes/storage/SQLStore/SimplePropertyStatisticsRebuilder.php b/includes/storage/SQLStore/SimplePropertyStatisticsRebuilder.php index 48c8cea..4e5d212 100644 --- a/includes/storage/SQLStore/SimplePropertyStatisticsRebuilder.php +++ b/includes/storage/SQLStore/SimplePropertyStatisticsRebuilder.php @@ -8,7 +8,7 @@ use SMW\Store; -use MWException; +use Exception; /** * Simple implementation of PropertyStatisticsRebuilder. diff --git a/includes/storage/StringCondition.php b/includes/storage/StringCondition.php index 378fbc1..028253a 100644 --- a/includes/storage/StringCondition.php +++ b/includes/storage/StringCondition.php @@ -32,4 +32,4 @@ $this->condition = $condition; } -} \ No newline at end of file +} diff --git a/languages/SMW_Aliases.php b/languages/SMW_Aliases.php index 86063be..3d4e1d1 100644 --- a/languages/SMW_Aliases.php +++ b/languages/SMW_Aliases.php @@ -830,4 +830,4 @@ 'URIResolver' => array( 'URI_分解器' ), 'UnusedProperties' => array( '未使用屬性' ), 'WantedProperties' => array( '需要的屬性' ), -); \ No newline at end of file +); diff --git a/languages/SMW_Magic.php b/languages/SMW_Magic.php index 3231952..14b600f 100644 --- a/languages/SMW_Magic.php +++ b/languages/SMW_Magic.php @@ -375,4 +375,4 @@ $magicWords['zh-hant'] = array( 'info' => array( 0, '資訊' ), 'set' => array( 0, '設定' ), -); \ No newline at end of file +); diff --git a/languages/SemanticMediaWiki.namespaces.php b/languages/SemanticMediaWiki.namespaces.php index 1d87c65..25a0df4 100644 --- a/languages/SemanticMediaWiki.namespaces.php +++ b/languages/SemanticMediaWiki.namespaces.php @@ -63,4 +63,4 @@ '型态讨论' => SMW_NS_TYPE_TALK, 'Concept' => SMW_NS_CONCEPT, 'Concept_talk' => SMW_NS_CONCEPT_TALK -); \ No newline at end of file +); diff --git a/maintenance/SMW_dumpRDF.php b/maintenance/SMW_dumpRDF.php index 0fc144b..58a900b 100644 --- a/maintenance/SMW_dumpRDF.php +++ b/maintenance/SMW_dumpRDF.php @@ -6,4 +6,4 @@ * @deprecated 2.0 This maintenance script has been deprecated, please use * dumpRDF.php instead. */ -require_once ( 'dumpRDF.php' ); \ No newline at end of file +require_once ( 'dumpRDF.php' ); diff --git a/maintenance/SMW_setup.php b/maintenance/SMW_setup.php index 7e4f6d4..2c9f85d 100644 --- a/maintenance/SMW_setup.php +++ b/maintenance/SMW_setup.php @@ -6,4 +6,4 @@ * @deprecated 2.0 This maintenance script has been deprecated, please use * setupStore.php instead. */ -require_once ( 'setupStore.php' ); \ No newline at end of file +require_once ( 'setupStore.php' ); diff --git a/tests/phpunit/Integration/MediaWiki/Import/Maintenance/RebuildPropertyStatisticsMaintenanceTest.php b/tests/phpunit/Integration/MediaWiki/Import/Maintenance/RebuildPropertyStatisticsMaintenanceTest.php index 0b1842c..7bc50bb 100644 --- a/tests/phpunit/Integration/MediaWiki/Import/Maintenance/RebuildPropertyStatisticsMaintenanceTest.php +++ b/tests/phpunit/Integration/MediaWiki/Import/Maintenance/RebuildPropertyStatisticsMaintenanceTest.php @@ -74,4 +74,4 @@ $maintenanceRunner->setQuiet()->run(); } -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Runners/XmlImportRunner.php b/tests/phpunit/Utils/Runners/XmlImportRunner.php index 9efb063..89f1528 100644 --- a/tests/phpunit/Utils/Runners/XmlImportRunner.php +++ b/tests/phpunit/Utils/Runners/XmlImportRunner.php @@ -148,4 +148,4 @@ } } -} \ No newline at end of file +} diff --git a/tests/phpunit/Utils/Validators/SemanticDataValidator.php b/tests/phpunit/Utils/Validators/SemanticDataValidator.php index 3f97f92..b505c3a 100644 --- a/tests/phpunit/Utils/Validators/SemanticDataValidator.php +++ b/tests/phpunit/Utils/Validators/SemanticDataValidator.php @@ -355,4 +355,4 @@ return is_array( $expected ) ? implode( ', ', $expected ) : $expected; } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/DefinesTest.php b/tests/phpunit/includes/DefinesTest.php index e2e5c34..df42076 100644 --- a/tests/phpunit/includes/DefinesTest.php +++ b/tests/phpunit/includes/DefinesTest.php @@ -61,4 +61,4 @@ public function testConstants( $constant, $expected ) { $this->assertEquals( $expected, $constant ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/FormatFactoryTest.php b/tests/phpunit/includes/FormatFactoryTest.php index 8995e06..dd290e9 100644 --- a/tests/phpunit/includes/FormatFactoryTest.php +++ b/tests/phpunit/includes/FormatFactoryTest.php @@ -145,7 +145,7 @@ * @since 1.9 */ public function testGetPrinterException() { - $this->SetExpectedException( 'MWException' ); + $this->SetExpectedException( 'Exception' ); $factory = $this->getNewInstance(); $factory->getPrinter( 'lula' ); @@ -159,7 +159,7 @@ * @since 1.9 */ public function testGetCanonicalNameException() { - $this->SetExpectedException( 'MWException' ); + $this->SetExpectedException( 'Exception' ); $factory = $this->getNewInstance(); $factory->getCanonicalName( 9001 ); @@ -174,7 +174,7 @@ * @since 1.9 */ public function testRegisterFormatException( $formatName, $class ) { - $this->SetExpectedException( 'MWException' ); + $this->SetExpectedException( 'Exception' ); $factory = $this->getNewInstance(); $factory->registerFormat( $formatName, $class ); @@ -188,7 +188,7 @@ * @since 1.9 */ public function testRegisterAliasesException( $formatName, array $aliases ) { - $this->SetExpectedException( 'MWException' ); + $this->SetExpectedException( 'Exception' ); $factory = $this->getNewInstance(); $factory->registerAliases( $formatName, $aliases ); diff --git a/tests/phpunit/includes/GlobalFunctionsTest.php b/tests/phpunit/includes/GlobalFunctionsTest.php index ba14cf5..a88a14c 100644 --- a/tests/phpunit/includes/GlobalFunctionsTest.php +++ b/tests/phpunit/includes/GlobalFunctionsTest.php @@ -144,4 +144,4 @@ array( array ( 'abc', 'ABC', '<span>Test</span>' ) , '<span>Test</span>', ',', true ), ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/Maintenance/DataRebuilderTest.php b/tests/phpunit/includes/Maintenance/DataRebuilderTest.php index b2eff46..2ee7e7d 100644 --- a/tests/phpunit/includes/Maintenance/DataRebuilderTest.php +++ b/tests/phpunit/includes/Maintenance/DataRebuilderTest.php @@ -291,4 +291,4 @@ $index++; } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/RecurringEventsTest.php b/tests/phpunit/includes/RecurringEventsTest.php index d4371f5..6012384 100644 --- a/tests/phpunit/includes/RecurringEventsTest.php +++ b/tests/phpunit/includes/RecurringEventsTest.php @@ -388,4 +388,4 @@ ), ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/Reporter/MessageReporterTestCase.php b/tests/phpunit/includes/Reporter/MessageReporterTestCase.php index a813adb..443bf9c 100644 --- a/tests/phpunit/includes/Reporter/MessageReporterTestCase.php +++ b/tests/phpunit/includes/Reporter/MessageReporterTestCase.php @@ -65,4 +65,4 @@ ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/SemanticDataTest.php b/tests/phpunit/includes/SemanticDataTest.php index 0fcb21f..f0083b6 100644 --- a/tests/phpunit/includes/SemanticDataTest.php +++ b/tests/phpunit/includes/SemanticDataTest.php @@ -202,7 +202,7 @@ $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); - $this->setExpectedException( 'MWException' ); + $this->setExpectedException( 'Exception' ); $instance->addSubSemanticData( new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( 'addSubSemanticData' ) ) ) @@ -213,7 +213,7 @@ $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); - $this->setExpectedException( 'MWException' ); + $this->setExpectedException( 'Exception' ); $instance->addSubobject( $this->newSubobject( Title::newFromText( 'addSubSemanticData' ) ) ); } @@ -221,7 +221,7 @@ $instance = new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( __METHOD__ ) ) ); - $this->setExpectedException( 'MWException' ); + $this->setExpectedException( 'Exception' ); $instance->importDataFrom( new SemanticData( DIWikiPage::newFromTitle( Title::newFromText( 'importDataFrom' ) ) ) diff --git a/tests/phpunit/includes/dataitems/DIConceptTest.php b/tests/phpunit/includes/dataitems/DIConceptTest.php index 4630df8..a8be8fd 100644 --- a/tests/phpunit/includes/dataitems/DIConceptTest.php +++ b/tests/phpunit/includes/dataitems/DIConceptTest.php @@ -92,4 +92,4 @@ ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/dataitems/DI_GeoCoordTest.php b/tests/phpunit/includes/dataitems/DI_GeoCoordTest.php index 86eefb2..b8ff7cf 100644 --- a/tests/phpunit/includes/dataitems/DI_GeoCoordTest.php +++ b/tests/phpunit/includes/dataitems/DI_GeoCoordTest.php @@ -44,4 +44,4 @@ ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/dataitems/DI_NumberTest.php b/tests/phpunit/includes/dataitems/DI_NumberTest.php index 28b2dfc..7615e40 100644 --- a/tests/phpunit/includes/dataitems/DI_NumberTest.php +++ b/tests/phpunit/includes/dataitems/DI_NumberTest.php @@ -60,4 +60,4 @@ ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/dataitems/DataItemTest.php b/tests/phpunit/includes/dataitems/DataItemTest.php index 7f8e253..cb42f87 100644 --- a/tests/phpunit/includes/dataitems/DataItemTest.php +++ b/tests/phpunit/includes/dataitems/DataItemTest.php @@ -141,4 +141,4 @@ $this->assertFalse( $di->equals( new \SMWDIBlob( '~=[,,_,,]:3' ) ) ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/dic/SimpleDependencyBuilderTest.php b/tests/phpunit/includes/dic/SimpleDependencyBuilderTest.php index 552e3ef..cf9120f 100644 --- a/tests/phpunit/includes/dic/SimpleDependencyBuilderTest.php +++ b/tests/phpunit/includes/dic/SimpleDependencyBuilderTest.php @@ -869,4 +869,4 @@ return $this->title; } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/export/SMWExpElementTest.php b/tests/phpunit/includes/export/SMWExpElementTest.php index 1264876..a1490f7 100644 --- a/tests/phpunit/includes/export/SMWExpElementTest.php +++ b/tests/phpunit/includes/export/SMWExpElementTest.php @@ -165,4 +165,4 @@ } } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/storage/sqlstore/PropertyStatisticsTableTest.php b/tests/phpunit/includes/storage/sqlstore/PropertyStatisticsTableTest.php index 3602f9d..fa3af19 100644 --- a/tests/phpunit/includes/storage/sqlstore/PropertyStatisticsTableTest.php +++ b/tests/phpunit/includes/storage/sqlstore/PropertyStatisticsTableTest.php @@ -26,7 +26,7 @@ /** * On the Windows platform pow( 2 , 31 ) returns with - * "MWException: The value to add must be a positive integer" therefore + * "Exception: The value to add must be a positive integer" therefore * return true if this test runs on Windows * * @return boolean -- To view, visit https://gerrit.wikimedia.org/r/184024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad0969e04d191aa2846a66a98c8e7aac314a4a6a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits