Skip to content
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

Stubs #70

Open
razshare opened this issue Nov 6, 2022 · 5 comments
Open

Stubs #70

razshare opened this issue Nov 6, 2022 · 5 comments

Comments

@razshare
Copy link

razshare commented Nov 6, 2022

Are there any stubs for this extension?
If yes where would I find them?

I'm in the process of writing some of my own stubs by hand.
So far I got all the examples working with stubs while playing with the extension.

I'm also in the process of learning to write php extensions and writing stubs is good exercise for me.
I was wondering if stubs would be helpful to someone, I don't mind continuing writing them for this extension.

@heckermanmajo
Copy link

I would love the stubs :)

@razshare razshare mentioned this issue Dec 13, 2022
@razshare
Copy link
Author

I'm not sure if the stubs belong in this repository, but I sent a PR #71, just in case.
Until then I've also posted them here.

If they get merged into this repo I'll probably delete or archive that repo.

I'm leaving this open until I get a yay or nay from the authors.

@remicollet
Copy link
Collaborator

See src/rect.stub.php which is for the SDL_Rect / SDL_Point classes

Best pratice is to add 1 stub per source file in the sources
which is used to auto-generate the arginfo.h file, and used by the C code.

razshare added a commit to razshare/php-sdl that referenced this issue Feb 17, 2023
@razshare
Copy link
Author

@remicollet hey I've got some spare time again in the weekends and I'm trying to follow your suggestion.
Do you think you could take a look at this file and give me some feedback as to what is missing if anything?

For examnple, I noticed the comment in the rect.sub.php file

/** @generate-class-entries */

is that necessary?

Another question I have is: does it matter if I specify the body of the functions/methods with random code?
I'm writing these mock contents because it's easier when my IDE is not screaming at me because of the errors.

@remicollet
Copy link
Collaborator

is that necessary?

Yes, this is needed to generate the C sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants
@remicollet @razshare @heckermanmajo and others