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..5138144 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 * 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/tests/Drupal/Tests/Core/Config/CachedStorageTest.php b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php index e01e505..ab962a3 100644 --- a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php @@ -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)); } }