Skip to content

Commit

Permalink
refactor #4 Deprecate the CacheEncoderDecorator (sstok)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.1-dev branch.
labels: deprecation

Discussion
----------

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT

The round trip of fetching cached encoded/decoded data is heavier then the performance gained. And therefor caching the decoded results is no longer considered a good practice.


Commits
-------

ea138c6 Deprecate the CacheEncoderDecorator
  • Loading branch information
sstok authored Jan 17, 2017
2 parents 48861ff + ea138c6 commit 340d7e8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ChangeLog

The changelog describes what is "Added", "Removed", "Changed" or "Fixed" between each release.

## v1.1.0

### Deprecated

* The `Rollerworks\Component\UriEncoder\Encoder\CacheEncoderDecorator`
is deprecated.

The round trip of fetching cached encoded/decoded data is heavier then the
performance gained. And therefor caching the decoded results is no longer
considered a good practice.
4 changes: 4 additions & 0 deletions src/CacheAdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@

namespace Rollerworks\Component\UriEncoder;

@trigger_error('The '.__NAMESPACE__.'\CacheAdapterInterface class is deprecated since version 1.1, to be removed in 2.0.', E_USER_DEPRECATED);

/**
* Interface for cache adapters.
*
* @deprecated since version 1.1, to be removed in 2.0.
*/
interface CacheAdapterInterface
{
Expand Down
4 changes: 4 additions & 0 deletions src/Encoder/CacheEncoderDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
use Rollerworks\Component\UriEncoder\CacheAdapterInterface;
use Rollerworks\Component\UriEncoder\UriEncoderInterface;

@trigger_error('The '.__NAMESPACE__.'\CacheEncoderDecorator class is deprecated since version 1.1, to be removed in 2.0.', E_USER_DEPRECATED);

/**
* CacheEncoderDecorator keeps a cached version of original data
* and delegates calls back to the original Encoder when no there is no cache.
*
* @author Sebastiaan Stok <[email protected]>
*
* @deprecated since version 1.1, to be removed in 2.0.
*/
class CacheEncoderDecorator implements UriEncoderInterface
{
Expand Down

0 comments on commit 340d7e8

Please sign in to comment.