From ea8bca51a08da7809840d6ece5ccf28f46d410e6 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 8 Apr 2014 10:08:56 +0100
Subject: [PATCH] Issue #2202401 by Berdir: Make getPropertyDefinition() return
 NULL instead of FALSE.

---
 core/lib/Drupal/Core/Config/Schema/Mapping.php         | 7 ++-----
 core/lib/Drupal/Core/Entity/ContentEntityBase.php      | 3 ---
 core/lib/Drupal/Core/Entity/ContentEntityInterface.php | 4 ++--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/core/lib/Drupal/Core/Config/Schema/Mapping.php b/core/lib/Drupal/Core/Config/Schema/Mapping.php
index 0caa9c7217ac..19fb596647d2 100644
--- a/core/lib/Drupal/Core/Config/Schema/Mapping.php
+++ b/core/lib/Drupal/Core/Config/Schema/Mapping.php
@@ -103,16 +103,13 @@ public function toArray() {
    * @param string $name
    *   The name of property.
    *
-   * @return array|FALSE
-   *   The definition of the property or FALSE if the property does not exist.
+   * @return array|null
+   *   The definition of the property or NULL if the property does not exist.
    */
   public function getPropertyDefinition($name) {
     if (isset($this->definition['mapping'][$name])) {
       return $this->definition['mapping'][$name];
     }
-    else {
-      return FALSE;
-    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index b63a9d88f64b..992c7281a37d 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -478,9 +478,6 @@ public function getFieldDefinition($name) {
     if (isset($this->fieldDefinitions[$name])) {
       return $this->fieldDefinitions[$name];
     }
-    else {
-      return FALSE;
-    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
index 1314fd1d6449..654fc5eb77ed 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php
@@ -109,8 +109,8 @@ public function hasField($field_name);
    * @param string $name
    *   The name of the field.
    *
-   * @return \Drupal\Core\Field\FieldDefinitionInterface|false
-   *   The definition of the field or FALSE if the field does not exist.
+   * @return \Drupal\Core\Field\FieldDefinitionInterface|null
+   *   The definition of the field or null if the field does not exist.
    */
   public function getFieldDefinition($name);
 
-- 
GitLab