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/DatabaseStorage.php b/core/lib/Drupal/Core/Config/DatabaseStorage.php index 20e5f1b..86dfae5 100644 --- a/core/lib/Drupal/Core/Config/DatabaseStorage.php +++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php @@ -87,7 +87,7 @@ public function exists($name) { * {@inheritdoc} */ public function read($name) { - $data = FALSE; + $data = NULL; try { $raw = $this->connection->query('SELECT data FROM {' . $this->connection->escapeTable($this->table) . '} WHERE collection = :collection AND name = :name', array(':collection' => $this->collection, ':name' => $name), $this->options)->fetchField(); if ($raw !== FALSE) { 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/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index e5e760e..1234c74 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -133,7 +133,7 @@ function testDeleted() { $this->configImporter->reset()->import(); // Verify the file has been removed. - $this->assertIdentical($storage->read($dynamic_name), FALSE); + $this->assertIdentical($storage->read($dynamic_name), NULL); $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('id'), NULL); diff --git a/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php b/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php index e3c4e76..46fe508 100644 --- a/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php +++ b/core/modules/config/src/Tests/Storage/ConfigStorageTestBase.php @@ -44,9 +44,9 @@ function testCRUD() { // Checking whether a non-existing name exists returns FALSE. $this->assertIdentical($this->storage->exists($name), FALSE); - // Reading a non-existing name returns FALSE. + // Reading a non-existing name returns NULL. $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'); @@ -139,9 +139,9 @@ public function testInvalidStorage() { $raw_data = $this->read($name); $this->assertIdentical($raw_data, $data); - // Reading from a non-existing storage bin returns FALSE. + // Reading from a non-existing storage bin returns NULL. $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)); } }