From 823d29f94aaf3ed4ad05179ae618b5169e98b94e Mon Sep 17 00:00:00 2001 From: Raissa North Date: Thu, 7 Dec 2017 09:36:12 +1300 Subject: [PATCH] ENHANCEMENT DataFormatter setters return for chaining --- src/DataFormatter.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/DataFormatter.php b/src/DataFormatter.php index 6d7e31e..2df9e9c 100644 --- a/src/DataFormatter.php +++ b/src/DataFormatter.php @@ -189,10 +189,12 @@ abstract class DataFormatter /** * @param array $fields + * @return $this */ public function setCustomFields($fields) { $this->customFields = $fields; + return $this; } /** @@ -205,18 +207,22 @@ abstract class DataFormatter /** * @param array $fields + * @return $this */ public function setCustomAddFields($fields) { $this->customAddFields = $fields; + return $this; } /** * @param array $relations + * @return $this */ public function setCustomRelations($relations) { $this->customRelations = $relations; + return $this; } /** @@ -237,10 +243,12 @@ abstract class DataFormatter /** * @param array $fields + * @return $this */ public function setRemoveFields($fields) { $this->removeFields = $fields; + return $this; } /** @@ -258,10 +266,12 @@ abstract class DataFormatter /** * @param int $size + * @return $this */ public function setTotalSize($size) { $this->totalSize = (int)$size; + return $this; } /** @@ -326,7 +336,6 @@ abstract class DataFormatter abstract public function supportedMimeTypes(); - /** * Convert a single data object to this format. Return a string. */