From ea8bca51a08da7809840d6ece5ccf28f46d410e6 Mon Sep 17 00:00:00 2001 From: Alex Pott 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 0caa9c7217a..19fb596647d 100644 --- a/core/lib/Drupal/Core/Config/Schema/Mapping.php +++ b/core/lib/Drupal/Core/Config/Schema/Mapping.php @@ -103,16 +103,13 @@ class Mapping extends ArrayElement implements ComplexDataInterface { * @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 b63a9d88f64..992c7281a37 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -478,9 +478,6 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C 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 1314fd1d644..654fc5eb77e 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityInterface.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityInterface.php @@ -109,8 +109,8 @@ interface ContentEntityInterface extends EntityInterface, RevisionableInterface, * @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);