Skip to content

Store.php : replace private methods/attributes to protected #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions HttpCache/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
class Store implements StoreInterface
{
protected $root;
private $keyCache;
private $locks;
protected $keyCache;
protected $locks;

/**
* Constructor.
Expand Down Expand Up @@ -258,7 +258,7 @@ public function invalidate(Request $request)
*
* @return Boolean true if the two environments match, false otherwise
*/
private function requestsMatch($vary, $env1, $env2)
protected function requestsMatch($vary, $env1, $env2)
{
if (empty($vary)) {
return true;
Expand All @@ -285,7 +285,7 @@ private function requestsMatch($vary, $env1, $env2)
*
* @return array An array of data associated with the key
*/
private function getMetadata($key)
protected function getMetadata($key)
{
if (false === $entries = $this->load($key)) {
return array();
Expand Down Expand Up @@ -319,7 +319,7 @@ public function purge($url)
*
* @return string The data associated with the key
*/
private function load($key)
protected function load($key)
{
$path = $this->getPath($key);

Expand All @@ -334,7 +334,7 @@ private function load($key)
*
* @return Boolean
*/
private function save($key, $data)
protected function save($key, $data)
{
$path = $this->getPath($key);
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
Expand Down Expand Up @@ -371,7 +371,7 @@ public function getPath($key)
*
* @return string A key for the given Request
*/
private function getCacheKey(Request $request)
protected function getCacheKey(Request $request)
{
if (isset($this->keyCache[$request])) {
return $this->keyCache[$request];
Expand All @@ -387,7 +387,7 @@ private function getCacheKey(Request $request)
*
* @return array An array of HTTP headers
*/
private function persistRequest(Request $request)
protected function persistRequest(Request $request)
{
return $request->headers->all();
}
Expand All @@ -399,7 +399,7 @@ private function persistRequest(Request $request)
*
* @return array An array of HTTP headers
*/
private function persistResponse(Response $response)
protected function persistResponse(Response $response)
{
$headers = $response->headers->all();
$headers['X-Status'] = array($response->getStatusCode());
Expand All @@ -415,7 +415,7 @@ private function persistResponse(Response $response)
*
* @return Response
*/
private function restoreResponse($headers, $body = null)
protected function restoreResponse($headers, $body = null)
{
$status = $headers['X-Status'][0];
unset($headers['X-Status']);
Expand Down