Skip to content

Commit

Permalink
Make methods protected to be able to extend the middleware (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
iPurpl3x authored Jun 1, 2023
1 parent 7bf9d1f commit d216c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Middleware/AddLanguageFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
*
* @return ServerRequestInterface
*/
private function addQueryParams(ServerRequestInterface $request, array $params, string $language): ServerRequestInterface
protected function addQueryParams(ServerRequestInterface $request, array $params, string $language): ServerRequestInterface
{
// use recursive merge to preserve filters added by other extensions
$newParams = array_merge_recursive($params, ['filter' => ['language' => $language]]);
Expand All @@ -115,7 +115,7 @@ private function addQueryParams(ServerRequestInterface $request, array $params,
return $request->withQueryParams($newParams);
}

private function isDiscussionListPath($request)
protected function isDiscussionListPath($request)
{
$path = $request->getAttribute('originalUri')->getPath();

Expand All @@ -137,7 +137,7 @@ private function isDiscussionListPath($request)
return false;
}

private function determineLanguageFromBrowserRequest(string $acceptLangs): string
protected function determineLanguageFromBrowserRequest(string $acceptLangs): string
{
$langs = [];
// break up string into pieces (languages and q factors)
Expand Down

0 comments on commit d216c7e

Please sign in to comment.