This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cache injection via parser manager
- Loading branch information
Showing
5 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* Dash | ||
* | ||
* @link http://github.com/DASPRiD/Dash For the canonical source repository | ||
* @copyright 2013 Ben Scholzen 'DASPRiD' | ||
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License | ||
*/ | ||
|
||
namespace Dash\Router\Http\Parser; | ||
|
||
use Zend\Cache\Storage\StorageInterface; | ||
|
||
/** | ||
* Interface for parsers which are cache aware. | ||
*/ | ||
interface CacheAwareInterface | ||
{ | ||
/** | ||
* Sets a cache used by the parser. | ||
* | ||
* @param null|StorageInterface $cache | ||
*/ | ||
public function setCache(StorageInterface $cache = null); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/DashTest/Router/Http/Parser/Asset/CacheAwareParserInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Dash | ||
* | ||
* @link http://github.com/DASPRiD/Dash For the canonical source repository | ||
* @copyright 2013 Ben Scholzen 'DASPRiD' | ||
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License | ||
*/ | ||
|
||
namespace DashTest\Router\Http\Parser\Asset; | ||
|
||
use Dash\Router\Http\Parser\CacheAwareInterface; | ||
use Dash\Router\Http\Parser\ParserInterface; | ||
|
||
/** | ||
* This is a workaround, since stubbing multiple interfaces is not yet in any | ||
* stable tag. | ||
* | ||
* @see https://github.com/sebastianbergmann/phpunit-mock-objects/commit/73e7b0766ad6223e713ac87cfe5d4e211bd18af0 | ||
*/ | ||
interface CacheAwareParserInterface extends CacheAwareInterface, ParserInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters