Issue #3138595 by jungle, Kumar Kundan, markdorison, kkalashnikov, ankitsingh0188, mrinalini9, walangitan, _utsavsharma, himanshu_sindhwani, atul4drupal, smustgrave, xjm, alexpott, daffie: Replace method names that use writeable with writable
parent
8df5eabfba
commit
09a5ff9f5c
|
@ -65,10 +65,18 @@ class FileReadOnlyStorage implements PhpStorageInterface {
|
||||||
return $this->directory . '/' . $name;
|
return $this->directory . '/' . $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function writable() {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function writeable() {
|
public function writeable() {
|
||||||
|
@trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use \Drupal\Component\PhpStorage\FileReadOnlyStorage::writable() instead. See https://www.drupal.org/node/3155413', E_USER_DEPRECATED);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,18 @@ class FileStorage implements PhpStorageInterface {
|
||||||
return $this->directory . '/' . $name;
|
return $this->directory . '/' . $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function writable() {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function writeable() {
|
public function writeable() {
|
||||||
|
@trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use \Drupal\Component\PhpStorage\FileStorage::writable() instead. See https://www.drupal.org/node/3155413', E_USER_DEPRECATED);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,20 @@ interface PhpStorageInterface {
|
||||||
* Whether this is a writable storage.
|
* Whether this is a writable storage.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* TRUE if writable, otherwise FALSE.
|
||||||
|
*/
|
||||||
|
public function writable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this is a writable storage.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* TRUE if writable, otherwise FALSE.
|
||||||
|
*
|
||||||
|
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
|
||||||
|
* \Drupal\Component\PhpStorage\PhpStorageInterface::writable() instead.
|
||||||
|
*
|
||||||
|
* @see https://www.drupal.org/node/3155413
|
||||||
*/
|
*/
|
||||||
public function writeable();
|
public function writeable();
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Drupal\Tests\Component\PhpStorage;
|
||||||
use Drupal\Component\PhpStorage\FileStorage;
|
use Drupal\Component\PhpStorage\FileStorage;
|
||||||
use Drupal\Component\PhpStorage\FileReadOnlyStorage;
|
use Drupal\Component\PhpStorage\FileReadOnlyStorage;
|
||||||
use Drupal\Component\Utility\Random;
|
use Drupal\Component\Utility\Random;
|
||||||
|
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Drupal\Component\PhpStorage\FileReadOnlyStorage
|
* @coversDefaultClass \Drupal\Component\PhpStorage\FileReadOnlyStorage
|
||||||
|
@ -14,6 +15,8 @@ use Drupal\Component\Utility\Random;
|
||||||
*/
|
*/
|
||||||
class FileStorageReadOnlyTest extends PhpStorageTestBase {
|
class FileStorageReadOnlyTest extends PhpStorageTestBase {
|
||||||
|
|
||||||
|
use ExpectDeprecationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard test settings to pass to storage instances.
|
* Standard test settings to pass to storage instances.
|
||||||
*
|
*
|
||||||
|
@ -79,8 +82,10 @@ class FileStorageReadOnlyTest extends PhpStorageTestBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::writeable
|
* @covers ::writeable
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testWriteable() {
|
public function testWritable() {
|
||||||
|
$this->expectDeprecation('Drupal\Component\PhpStorage\FileReadOnlyStorage::writeable() is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use \Drupal\Component\PhpStorage\FileReadOnlyStorage::writable() instead. See https://www.drupal.org/node/3155413');
|
||||||
$php_read = new FileReadOnlyStorage($this->readonlyStorage);
|
$php_read = new FileReadOnlyStorage($this->readonlyStorage);
|
||||||
$this->assertFalse($php_read->writeable());
|
$this->assertFalse($php_read->writeable());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ use Drupal\Component\PhpStorage\FileStorage;
|
||||||
use Drupal\Component\Utility\Random;
|
use Drupal\Component\Utility\Random;
|
||||||
use Drupal\Tests\Traits\PhpUnitWarnings;
|
use Drupal\Tests\Traits\PhpUnitWarnings;
|
||||||
use org\bovigo\vfs\vfsStreamDirectory;
|
use org\bovigo\vfs\vfsStreamDirectory;
|
||||||
|
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage
|
* @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage
|
||||||
|
@ -14,7 +15,7 @@ use org\bovigo\vfs\vfsStreamDirectory;
|
||||||
*/
|
*/
|
||||||
class FileStorageTest extends PhpStorageTestBase {
|
class FileStorageTest extends PhpStorageTestBase {
|
||||||
|
|
||||||
use PhpUnitWarnings;
|
use PhpUnitWarnings, ExpectDeprecationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard test settings to pass to storage instances.
|
* Standard test settings to pass to storage instances.
|
||||||
|
@ -50,8 +51,10 @@ class FileStorageTest extends PhpStorageTestBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::writeable
|
* @covers ::writeable
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testWriteable() {
|
public function testWritable() {
|
||||||
|
$this->expectDeprecation('Drupal\Component\PhpStorage\FileStorage::writeable() is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use \Drupal\Component\PhpStorage\FileStorage::writable() instead. See https://www.drupal.org/node/3155413');
|
||||||
$php = new FileStorage($this->standardSettings);
|
$php = new FileStorage($this->standardSettings);
|
||||||
$this->assertTrue($php->writeable());
|
$this->assertTrue($php->writeable());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue