From 14acb4ff8fd80575087a6e7db88488f8c6ca21d1 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 9 Oct 2016 00:20:22 +0200 Subject: [PATCH] deprecate some not needed statement filter methods --- CHANGELOG.md | 4 ++++ UPGRADE.md | 4 ++++ src/StatementsFilter.php | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cc94b0..6b33436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ CHANGELOG 1.1.0 ----- +* The `StatementsFilter::format()`, `StatementsFilter::includeAttachments()`, + and `StatementsFilter::excludeAttachments()` methods are deprecated and will + be removed in 2.0. + * Added a `$content` attribute to the `Attachment` class to make it possible to attach the raw content to an attachment. diff --git a/UPGRADE.md b/UPGRADE.md index afa7bcc..a12a830 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -4,6 +4,10 @@ UPGRADE Upgrading from 1.0 to 1.1 ------------------------- +* The `StatementsFilter::format()`, `StatementsFilter::includeAttachments()`, + and `StatementsFilter::excludeAttachments()` methods are deprecated and will + be removed in 2.0. + * Constructing an `Attachment` instance with specifying neither a file URL nor the raw attachment content throws an `\InvalidArgumentException`. diff --git a/src/StatementsFilter.php b/src/StatementsFilter.php index d584563..838c717 100644 --- a/src/StatementsFilter.php +++ b/src/StatementsFilter.php @@ -199,6 +199,8 @@ public function limit($limit) */ public function format($format) { + @trigger_error(sprintf('The "%s()" method is deprecated since 1.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + if (!in_array($format, array('ids', 'exact', 'canonical'))) { throw new \InvalidArgumentException('Unknown format '.$format.' given'); } @@ -215,6 +217,8 @@ public function format($format) */ public function includeAttachments() { + @trigger_error(sprintf('The "%s()" method is deprecated since 1.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + $this->filter['attachments'] = 'true'; return $this; @@ -227,6 +231,8 @@ public function includeAttachments() */ public function excludeAttachments() { + @trigger_error(sprintf('The "%s()" method is deprecated since 1.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + $this->filter['attachments'] = 'false'; return $this;