From: Aaron Schulz Date: Fri, 3 May 2019 19:19:18 +0000 (-0700) Subject: rdbms: fix some phpstorm warnings database classes X-Git-Tag: 1.34.0-rc.0~1022^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=0848e9049c66f6400624a40427b6abc6476f28a5;p=lhc%2Fweb%2Fwiklou.git rdbms: fix some phpstorm warnings database classes Change-Id: Ib3b8aaadda8101ed82158b1260f10f6d7be16783 --- diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 954d400cf0..5daf892c00 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -884,9 +884,12 @@ __INDEXATTR__; } /** + * @param string $prefix Only show tables with this prefix, e.g. mw_ + * @param string $fname Calling function name + * @return string[] * @suppress SecurityCheck-SQLInjection array_map not recognized T204911 */ - public function listTables( $prefix = null, $fname = __METHOD__ ) { + public function listTables( $prefix = '', $fname = __METHOD__ ) { $eschemas = implode( ',', array_map( [ $this, 'addQuotes' ], $this->getCoreSchemas() ) ); $result = $this->query( "SELECT DISTINCT tablename FROM pg_tables WHERE schemaname IN ($eschemas)", $fname ); @@ -895,7 +898,7 @@ __INDEXATTR__; foreach ( $result as $table ) { $vars = get_object_vars( $table ); $table = array_pop( $vars ); - if ( !$prefix || strpos( $table, $prefix ) === 0 ) { + if ( $prefix == '' || strpos( $table, $prefix ) === 0 ) { $endArray[] = $table; } } diff --git a/includes/poolcounter/PoolCounterWork.php b/includes/poolcounter/PoolCounterWork.php index 16e439797f..737967959f 100644 --- a/includes/poolcounter/PoolCounterWork.php +++ b/includes/poolcounter/PoolCounterWork.php @@ -29,6 +29,8 @@ abstract class PoolCounterWork { protected $type = 'generic'; /** @var bool */ protected $cacheable = false; // does this override getCachedWork() ? + /** @var PoolCounter */ + private $poolCounter; /** * @param string $type The class of actions to limit concurrency for (task type)