Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Invalid method call in handler example (book module tutorial) #90

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
zio-mitch opened this issue Mar 12, 2025 · 0 comments · Fixed by #91
Closed

Invalid method call in handler example (book module tutorial) #90

zio-mitch opened this issue Mar 12, 2025 · 0 comments · Fixed by #91

Comments

@zio-mitch
Copy link
Contributor

Bug Report

There is an invalid call to method getBooks() on bookService (conatiner), when it should be done on repository taken from the bookService.

Q A
Version(s) 5

Summary

Wrong method call.

Current behavior

Code doesn't work because method does not exist.

How to reproduce

Follow the code until these lines:

    public function getCollection(ServerRequestInterface $request): ResponseInterface
    {
        # FIXME should be bookService->getRepository()->getBooks();
        $books = $this->bookService->getBooks($request->getQueryParams());

        return $this->createResponse($request, $books);
    }

Expected behavior

Code works because method exists

@alexmerlin alexmerlin linked a pull request Mar 14, 2025 that will close this issue
alexmerlin added a commit that referenced this issue Mar 14, 2025
Fixes: #90 invalid method call in book handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant