-
Notifications
You must be signed in to change notification settings - Fork 143
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
[Feature] Use type hint for methods #282
Comments
Hi @sylfabre 👋 thanks for opening this issue! I am wondering why you would need to use the The main reason for my question is because as far as I know, you wouldn't be able to autowire Those are just my questions about your use case. I think adding the types to the constructors would definitely be a good idea, especially now that all the current PHP versions support it. Feel free to create a PR for that if you have time for it 😃 |
@GabrielAnca I use Yes you're right, I still need to define the service because of the token. But with SF4 autowiring, I can only define scalar arguments of the constructor. So using type hinting makes me write less code |
@GabrielAnca here is my PR: #284 |
Makes sense, thank you for sharing that! It helps us understand how the SDK is used and how it could be improved in the future 😃 And also thanks for the PR! I'll release a new version so you can leverage it immediately |
Symfony4's auto-wiring feature requires type hint on constructors to work.
For instance
\Intercom\IntercomUsers::__construct($client)
should become\Intercom\IntercomUsers::__construct(IntercomClient $client)
.The text was updated successfully, but these errors were encountered: