*
* @since 1.27
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
*/
- abstract public function makeGlobalKey( $class, $component = null );
+ abstract public function makeGlobalKey( $class, ...$components );
/**
* Make a cache key, scoped to this instance's keyspace.
*
* @since 1.27
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
*/
- abstract public function makeKey( $class, $component = null );
+ abstract public function makeKey( $class, ...$components );
/**
* @param int $flag ATTR_* class constant
}
public function makeKeyInternal( $keyspace, $args ) {
- return $this->backend->makeKeyInternal( ...func_get_args() );
+ return $this->backend->makeKeyInternal( $keyspace, $args );
}
- public function makeKey( $class, $component = null ) {
- return $this->backend->makeKey( ...func_get_args() );
+ public function makeKey( $class, ...$components ) {
+ return $this->backend->makeKey( $class, ...$components );
}
- public function makeGlobalKey( $class, $component = null ) {
- return $this->backend->makeGlobalKey( ...func_get_args() );
+ public function makeGlobalKey( $class, ...$components ) {
+ return $this->backend->makeGlobalKey( $class, ...$components );
}
public function getLastError() {
* Make a global cache key.
*
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
*/
- public function makeGlobalKey( $class, $component = null );
+ public function makeGlobalKey( $class, ...$components );
/**
* Make a cache key, scoped to this instance's keyspace.
*
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
*/
- public function makeKey( $class, $component = null );
+ public function makeKey( $class, ...$components );
}
* Make a global cache key.
*
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
* @since 1.27
*/
- public function makeGlobalKey( $class, $component = null ) {
+ public function makeGlobalKey( $class, ...$components ) {
return $this->makeKeyInternal( 'global', func_get_args() );
}
* Make a cache key, scoped to this instance's keyspace.
*
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
* @since 1.27
*/
- public function makeKey( $class, $component = null ) {
+ public function makeKey( $class, ...$components ) {
return $this->makeKeyInternal( $this->keyspace, func_get_args() );
}
}
public function makeKeyInternal( $keyspace, $args ) {
- return $this->caches[0]->makeKeyInternal( ...func_get_args() );
+ return $this->caches[0]->makeKeyInternal( $keyspace, $args );
}
- public function makeKey( $class, $component = null ) {
+ public function makeKey( $class, ...$components ) {
return $this->caches[0]->makeKey( ...func_get_args() );
}
- public function makeGlobalKey( $class, $component = null ) {
+ public function makeGlobalKey( $class, ...$components ) {
return $this->caches[0]->makeGlobalKey( ...func_get_args() );
}
return $this->writeStore->makeKeyInternal( ...func_get_args() );
}
- public function makeKey( $class, $component = null ) {
+ public function makeKey( $class, ...$components ) {
return $this->writeStore->makeKey( ...func_get_args() );
}
- public function makeGlobalKey( $class, $component = null ) {
+ public function makeGlobalKey( $class, ...$components ) {
return $this->writeStore->makeGlobalKey( ...func_get_args() );
}
/**
* @see BagOStuff::makeKey()
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
* @since 1.27
*/
- public function makeKey( $class, $component = null ) {
+ public function makeKey( $class, ...$components ) {
return $this->cache->makeKey( ...func_get_args() );
}
/**
* @see BagOStuff::makeGlobalKey()
* @param string $class Key class
- * @param string|null $component [optional] Key component (starting with a key collection name)
- * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ * @param string ...$components Key components (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components
* @since 1.27
*/
- public function makeGlobalKey( $class, $component = null ) {
+ public function makeGlobalKey( $class, ...$components ) {
return $this->cache->makeGlobalKey( ...func_get_args() );
}
* @covers CachedBagOStuff::makeKey
*/
public function testMakeKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ // This works fine on HHVM (and verified by integration tests), but due to
+ // a bug in HHVM's Reflection, PHPUnit 4 fails to create a mock (T228563)
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$backend = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeKey' ] )
->getMock();
* @covers CachedBagOStuff::makeGlobalKey
*/
public function testMakeGlobalKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$backend = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeGlobalKey' ] )
->getMock();
* @covers MultiWriteBagOStuff::makeKey
*/
public function testMakeKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$cache1 = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeKey' ] )->getMock();
$cache1->expects( $this->once() )->method( 'makeKey' )
* @covers MultiWriteBagOStuff::makeGlobalKey
*/
public function testMakeGlobalKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$cache1 = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeGlobalKey' ] )->getMock();
$cache1->expects( $this->once() )->method( 'makeGlobalKey' )
* @covers WANObjectCache::makeKey
*/
public function testMakeKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$backend = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeKey' ] )->getMock();
$backend->expects( $this->once() )->method( 'makeKey' )
* @covers WANObjectCache::makeGlobalKey
*/
public function testMakeGlobalKey() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$backend = $this->getMockBuilder( HashBagOStuff::class )
->setMethods( [ 'makeGlobalKey' ] )->getMock();
$backend->expects( $this->once() )->method( 'makeGlobalKey' )
* @return PHPUnit_Framework_MockObject_MockObject|HashBagOStuff
*/
private function getMockCache() {
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$mock = $this->getMockBuilder( HashBagOStuff::class )
->disableOriginalConstructor()
->setMethods( [ 'get', 'set', 'delete', 'makeKey' ] )
protected function setUp() {
parent::setUp();
+
+ if ( defined( 'HHVM_VERSION' ) ) {
+ $this->markTestSkipped( 'HHVM Reflection buggy' );
+ }
+
$cache = $this->getMockBuilder( RedisBagOStuff::class )
->disableOriginalConstructor()
->getMock();