- tidy
before_script:
+ - echo 'opcache.enable_cli = 1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer install --prefer-source --quiet --no-interaction
- if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
- >
},
"ParserTestFiles": {
"type": "array",
- "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
+ "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
},
"ServiceWiringFiles": {
"type": "array",
},
"ParserTestFiles": {
"type": "array",
- "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
+ "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
},
"ServiceWiringFiles": {
"type": "array",
* @copyright © 2011, Antoine Musso
*/
-use Wikimedia\Rdbms\ResultWrapper;
use Wikimedia\Rdbms\FakeResultWrapper;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IResultWrapper;
use MediaWiki\MediaWikiServices;
/**
*
* Initialized with BacklinkCache::getLinks()
* Cleared with BacklinkCache::clear()
- * @var ResultWrapper[]
+ * @var IResultWrapper[]
*/
protected $fullResultCache = [];
* @param int|bool $endId
* @param int $max
* @param string $select 'all' or 'ids'
- * @return ResultWrapper
+ * @return IResultWrapper
*/
protected function queryLinks( $table, $startId, $endId, $max, $select = 'all' ) {
$fromField = $this->getPrefix( $table ) . '_from';
/**
* Partition a DB result with backlinks in it into batches
- * @param ResultWrapper $res Database result
+ * @param IResultWrapper $res Database result
* @param int $batchSize
* @param bool $isComplete Whether $res includes all the backlinks
* @throws MWException
*/
use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\IDatabase;
/**
* parsing to avoid extra DB queries.
*
* @param LinkCache $cache
- * @param ResultWrapper $res
+ * @param IResultWrapper $res
* @return array Array of remaining titles
*/
public function addResultToCache( $cache, $res ) {
/**
* Perform the existence test query, return a ResultWrapper with page_id fields
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
*/
public function doQuery() {
if ( $this->isEmpty() ) {
use Wikimedia\Rdbms\DatabaseDomain;
use Wikimedia\Rdbms\Blob;
use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\DBConnectionError;
use Wikimedia\Rdbms\DBUnexpectedError;
use Wikimedia\Rdbms\DBExpectedError;
/**
* Frees resources associated with the LOB descriptor
- * @param ResultWrapper|ORAResult $res
+ * @param IResultWrapper|ORAResult $res
*/
function freeResult( $res ) {
if ( $res instanceof ResultWrapper ) {
}
/**
- * @param ResultWrapper|ORAResult $res
- * @return mixed
+ * @param IResultWrapper|ORAResult $res
+ * @return stdClass|bool
*/
function fetchObject( $res ) {
if ( $res instanceof ResultWrapper ) {
}
/**
- * @param ResultWrapper|ORAResult $res
- * @return mixed
+ * @param IResultWrapper|ORAResult $res
+ * @return stdClass|bool
*/
function fetchRow( $res ) {
if ( $res instanceof ResultWrapper ) {
}
/**
- * @param ResultWrapper|ORAResult $res
+ * @param IResultWrapper|ORAResult $res
* @return int
*/
function numRows( $res ) {
}
/**
- * @param ResultWrapper|ORAResult $res
+ * @param IResultWrapper|ORAResult $res
* @return int
*/
function numFields( $res ) {
}
/**
+ * @internal For testing only
* @return float UNIX timestamp
* @codeCoverageIgnore
*/
- protected function getCurrentTime() {
+ public function getCurrentTime() {
return $this->wallClockOverride ?: microtime( true );
}
/**
- * @param float|null &$time Mock UNIX timestamp for testing
+ * @internal For testing only
+ * @param float|null &$time Mock UNIX timestamp
* @codeCoverageIgnore
*/
public function setMockTime( &$time ) {
* @param string $commentedSql SQL query with debugging/trace comment
* @param bool $isEffectiveWrite Whether the query is a (non-temporary table) write
* @param string $fname Name of the calling function
- * @return bool|ResultWrapper True for a successful write query, ResultWrapper
+ * @return bool|IResultWrapper True for a successful write query, ResultWrapper
* object for a successful read query, or false on failure
*/
private function attemptQuery( $sql, $commentedSql, $isEffectiveWrite, $fname ) {
* a wrapper. Nowadays, raw database objects are never exposed to external
* callers, so this is unnecessary in external code.
*
- * @param bool|ResultWrapper|resource $result
- * @return bool|ResultWrapper
+ * @param bool|IResultWrapper|resource $result
+ * @return bool|IResultWrapper
*/
protected function resultObject( $result ) {
if ( !$result ) {
* Delete a table
* @param string $tableName
* @param string $fName
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
* @since 1.18
*/
public function dropTable( $tableName, $fName = __METHOD__ ) {
* Delete a table
* @param string $tableName
* @param string $fName
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
* @since 1.18
*/
public function dropTable( $tableName, $fName = __METHOD__ ) {
abstract protected function mysqlSetCharset( $charset );
/**
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @throws DBUnexpectedError
*/
public function freeResult( $res ) {
abstract protected function mysqlFreeResult( $res );
/**
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @return stdClass|bool
* @throws DBUnexpectedError
*/
/**
* @throws DBUnexpectedError
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @return int
*/
function numRows( $res ) {
abstract protected function mysqlNumRows( $res );
/**
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @return int
*/
public function numFields( $res ) {
abstract protected function mysqlNumFields( $res );
/**
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $n
* @return string
*/
/**
* Get the name of the specified field in a result
*
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $n
* @return string
*/
/**
* mysql_field_type() wrapper
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $n
* @return string
*/
/**
* Get the type of the specified field in a result
*
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $n
* @return string
*/
abstract protected function mysqlFieldType( $res, $n );
/**
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $row
* @return bool
*/
/**
* Move internal result pointer
*
- * @param ResultWrapper|resource $res
+ * @param IResultWrapper|resource $res
* @param int $row
* @return bool
*/
/**
* @param string $tableName
* @param string $fName
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
*/
public function dropTable( $tableName, $fName = __METHOD__ ) {
if ( !$this->tableExists( $tableName, $fName ) ) {
* @param bool|string $file Database file name. If omitted, will be generated
* using $name and configured data directory
* @param string $fname Calling function name
- * @return ResultWrapper
+ * @return IResultWrapper
*/
function attachDatabase( $name, $file = false, $fname = __METHOD__ ) {
if ( !$file ) {
* SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result
*
* @param string $sql
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
*/
protected function doQuery( $sql ) {
$res = $this->getBindingHandle()->query( $sql );
}
/**
- * @param ResultWrapper|mixed $res
+ * @param IResultWrapper|mixed $res
*/
function freeResult( $res ) {
if ( $res instanceof ResultWrapper ) {
}
/**
- * @param ResultWrapper|array $res
+ * @param IResultWrapper|array $res
* @return stdClass|bool
*/
function fetchObject( $res ) {
}
/**
- * @param ResultWrapper|mixed $res
+ * @param IResultWrapper|mixed $res
* @return array|bool
*/
function fetchRow( $res ) {
/**
* The PDO::Statement class implements the array interface so count() will work
*
- * @param ResultWrapper|array|false $res
+ * @param IResultWrapper|array|false $res
* @return int
*/
function numRows( $res ) {
}
/**
- * @param ResultWrapper $res
+ * @param IResultWrapper $res
* @return int
*/
function numFields( $res ) {
}
/**
- * @param ResultWrapper $res
+ * @param IResultWrapper $res
* @param int $n
* @return bool
*/
}
/**
- * @param ResultWrapper|array $res
+ * @param IResultWrapper|array $res
* @param int $row
*/
function dataSeek( $res, $row ) {
* @param string $newName
* @param bool $temporary
* @param string $fname
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
* @throws RuntimeException
*/
function duplicateTableStructure( $oldName, $newName, $temporary = false, $fname = __METHOD__ ) {
*
* @param string $tableName
* @param string $fName
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
* @throws DBReadOnlyError
*/
public function dropTable( $tableName, $fName = __METHOD__ ) {
* the LB info array is set to that parameter. If it is called with two
* parameters, the member with the given name is set to the given value.
*
- * @param string $name
+ * @param array|string $name
* @param array|null $value
*/
public function setLBInfo( $name, $value = null );
* Delete a table
* @param string $tableName
* @param string $fName
- * @return bool|ResultWrapper
+ * @return bool|IResultWrapper
*/
public function dropTable( $tableName, $fName = __METHOD__ );
* @param string $table Table name
* @param string $field Field name
*
- * @return Field
+ * @return false|Field
*/
public function fieldInfo( $table, $field );
}
}
}
+ // Deprecated stuff
+ if ( isset( $data->ParserTestFiles ) ) {
+ // phpcs:ignore Generic.Files.LineLength.TooLong
+ $extraErrors[] = '[ParserTestFiles] DEPRECATED: see <https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#ParserTestFiles>';
+ }
+
$validator = new Validator;
$validator->check( $data, (object)[ '$ref' => 'file://' . $schemaPath ] );
if ( $validator->isValid() && !$extraErrors ) {