diff --git a/src/Entity/Paragraph.php b/src/Entity/Paragraph.php index 6718733..a021c58 100644 --- a/src/Entity/Paragraph.php +++ b/src/Entity/Paragraph.php @@ -441,13 +441,13 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface, EntityN /** * {@inheritdoc} */ - public function getSummary($options = []) { + public function getSummary(array $options = []) { $allowed_bundles = isset($options['allowed_bundles']) ? $options['allowed_bundles'] : NULL; $show_behavior_summary = isset ($options['show_behavior_summary']) ? $options['show_behavior_summary'] : TRUE; $summary = []; $this->summaryCount = 0; - if ($this->bundle() !== NULL && (is_array($allowed_bundles) && !in_array($this->bundle(), $allowed_bundles))) { + if ($this->bundle() !== NULL && is_array($allowed_bundles) && !in_array($this->bundle(), $allowed_bundles)) { return ''; } @@ -562,7 +562,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface, EntityN * @return string * Short summary for nested paragraphs type. */ - protected function getNestedSummary($field_name, $options) { + protected function getNestedSummary($field_name, array $options) { $summary = []; $summary_count = 0; foreach ($this->{$field_name}->getValue() as $value) { diff --git a/src/ParagraphInterface.php b/src/ParagraphInterface.php index 937df01..728bb3c 100644 --- a/src/ParagraphInterface.php +++ b/src/ParagraphInterface.php @@ -24,12 +24,12 @@ interface ParagraphInterface extends ContentEntityInterface, EntityOwnerInterfac /** * Returns short summary for paragraph. * - * @param array|null $options + * @param array $options * Array of paragraph options. * * @return string * The text without tags. */ - public function getSummary($options = []); + public function getSummary(array $options = []); }