diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index e060cdf..894b3ee 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -960,7 +960,7 @@ protected function importInvokeOwner($collection, $op, $name) { $data = $this->storageComparer->getSourceStorage($collection)->read($name); $new_config = new Config($name, $this->storageComparer->getTargetStorage($collection), $this->eventDispatcher, $this->typedConfigManager); - if ($data !== FALSE) { + if ($data !== NULL) { $new_config->setData($data); } diff --git a/core/lib/Drupal/Core/Config/FileStorage.php b/core/lib/Drupal/Core/Config/FileStorage.php index 88af39e..69c18cb 100644 --- a/core/lib/Drupal/Core/Config/FileStorage.php +++ b/core/lib/Drupal/Core/Config/FileStorage.php @@ -94,7 +94,7 @@ public function exists($name) { */ public function read($name) { if (!$this->exists($name)) { - return FALSE; + return NULL; } $data = file_get_contents($this->getFilePath($name)); try { diff --git a/core/lib/Drupal/Core/Config/StorageInterface.php b/core/lib/Drupal/Core/Config/StorageInterface.php index f6145b8..ac523ce 100644 --- a/core/lib/Drupal/Core/Config/StorageInterface.php +++ b/core/lib/Drupal/Core/Config/StorageInterface.php @@ -37,9 +37,9 @@ public function exists($name); * @param string $name * The name of a configuration object to load. * - * @return array|bool + * @return array|null * The configuration data stored for the configuration object name. If no - * configuration data exists for the given name, FALSE is returned. + * configuration data exists for the given name, NULL is returned. */ public function read($name); diff --git a/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php b/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php index e3c4e76..4e6e64b 100644 --- a/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php +++ b/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php @@ -46,7 +46,7 @@ function testCRUD() { // Reading a non-existing name returns FALSE. $data = $this->storage->read($name); - $this->assertIdentical($data, FALSE); + $this->assertIdentical($data, NULL); // Writing data returns TRUE and the data has been written. $data = array('foo' => 'bar'); @@ -141,7 +141,7 @@ public function testInvalidStorage() { // Reading from a non-existing storage bin returns FALSE. $result = $this->invalidStorage->read($name); - $this->assertIdentical($result, FALSE); + $this->assertIdentical($result, NULL); // Deleting from a non-existing storage bin throws an exception. try { diff --git a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php index e01e505..770c268 100644 --- a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php @@ -105,7 +105,7 @@ public function testGetMultipleOnPartiallyPrimedCache() { foreach ($configCacheValues as $key => $value) { $cache->set($key, $value); } - $cache->set('config.does_not_exist_cached', FALSE); + $cache->set('config.does_not_exist_cached', NULL); $config_exists_not_cached_data = array('foo' => 'bar'); $response = array( @@ -124,7 +124,7 @@ public function testGetMultipleOnPartiallyPrimedCache() { // Ensure that the a missing file is cached. $entry = $cache->get('config.does_not_exist'); - $this->assertFalse($entry->data); + $this->assertNull($entry->data); // Ensure that the a file containing data is cached. $entry = $cache->get('config.exists_not_cached'); @@ -141,15 +141,15 @@ public function testReadNonExistentFileCacheMiss() { $storage->expects($this->once()) ->method('read') ->with($name) - ->will($this->returnValue(FALSE)); + ->will($this->returnValue(NULL)); $cachedStorage = new CachedStorage($storage, $cache); - $this->assertFalse($cachedStorage->read($name)); + $this->assertNull($cachedStorage->read($name)); // Ensure that the a missing file is cached. $entry = $cache->get('config.does_not_exist'); - $this->assertFalse($entry->data); + $this->assertNull($entry->data); } /** @@ -158,14 +158,14 @@ public function testReadNonExistentFileCacheMiss() { public function testReadNonExistentFileCached() { $name = 'config.does_not_exist'; $cache = new MemoryBackend(__FUNCTION__); - $cache->set($name, FALSE); + $cache->set($name, NULL); $storage = $this->getMock('Drupal\Core\Config\StorageInterface'); $storage->expects($this->never()) ->method('read'); $cachedStorage = new CachedStorage($storage, $cache); - $this->assertFalse($cachedStorage->read($name)); + $this->assertNull($cachedStorage->read($name)); } }