Skip to content

Commit

Permalink
feat(chore): pass public function to protected
Browse files Browse the repository at this point in the history
fix #51
  • Loading branch information
jorisdugue committed Jan 30, 2024
1 parent c21221c commit 9df2181
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
24 changes: 11 additions & 13 deletions Core/H5PSymfony.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,16 @@ class H5PSymfony implements \H5PFrameworkInterface
* @param RouterInterface $router
*/
public function __construct(
H5POptions $options,
EditorStorage $editorStorage,
TokenStorageInterface $tokenStorage,
EntityManagerInterface $manager,
?Session $session,
?RequestStack $requestStack,
H5POptions $options,
EditorStorage $editorStorage,
TokenStorageInterface $tokenStorage,
EntityManagerInterface $manager,
?Session $session,
?RequestStack $requestStack,
AuthorizationCheckerInterface $authorizationChecker,
EventDispatcherInterface $eventDispatcher,
RouterInterface $router
)
{
EventDispatcherInterface $eventDispatcher,
RouterInterface $router
) {
$this->options = $options;
$this->editorStorage = $editorStorage;
$this->tokenStorage = $tokenStorage;
Expand Down Expand Up @@ -158,8 +157,7 @@ public function fetchExternalData(
$headers = [],
$files = [],
$method = 'POST'
)
{
) {
$options = [];
if (!empty($data)) {
$options['headers'] = ['Content-Type' => 'application/x-www-form-urlencoded'];
Expand Down Expand Up @@ -893,7 +891,7 @@ public function getOption($name, $default = null)
try {
// return default if db/table still not created
return $this->options->getOption($name, $default);
} catch (ConnectionException|TableNotFoundException $e) {
} catch (ConnectionException | TableNotFoundException $e) {
return $default;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Core/H5PUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(TokenStorageInterface $tokenStorage)
* Fetch the current user if not present return the anonymous user
* @return string|UserInterface|null
*/
public function getCurrentOrAnonymousUser()
protected function getCurrentOrAnonymousUser()
{
$token = $this->tokenStorage->getToken();

Expand All @@ -36,7 +36,7 @@ public function getCurrentOrAnonymousUser()
* @param UserInterface|null $user
* @return string|null|integer
*/
public function getUserId(?UserInterface $user)
protected function getUserId(?UserInterface $user)
{
if ($user !== null) {
if (method_exists($user, 'getId')) {
Expand Down
2 changes: 1 addition & 1 deletion Twig/H5PExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(H5PIntegration $h5pIntegration)

public function getFilters(): array
{
return [new TwigFilter('h5pCacheBuster', [$this, 'getH5PCacheBuster']),];
return [new TwigFilter('h5pCacheBuster', [$this, 'getH5PCacheBuster'])];
}

public function getH5PCacheBuster($script): string
Expand Down

0 comments on commit 9df2181

Please sign in to comment.