Skip to content

Commit

Permalink
deprecate some not needed statement filter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 8, 2016
1 parent 2a9e7fe commit 14acb4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
6 changes: 6 additions & 0 deletions src/StatementsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 14acb4f

Please # to comment.