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

Should we add strict typing? #3

Open
jcarlosroldan opened this issue Feb 14, 2024 · 0 comments
Open

Should we add strict typing? #3

jcarlosroldan opened this issue Feb 14, 2024 · 0 comments
Labels
feature request I want this in the app

Comments

@jcarlosroldan
Copy link
Owner

jcarlosroldan commented Feb 14, 2024

For instance, the serve function would look like this:

function serve(
    string $endpointsPath,
    ?string $path = null,
    bool $debug = false,
    string $basePath = "/api/",
    bool $escapeUnicode = false,
    bool $allowGet = false
): void {...}

PROS:

  • More robust code.
  • Easier debugging.
  • Better documented code.

CONS:

  • Could raise annoyances that could decrease dev speed like Argument 1 passed to id() must be of the type int, float given.
  • Some type names collapse with my function names.

I lean towards keeping it as-is, in the spirit of quick-and-dirty, but I have to assess how much of an annoyance each option would be.

@jcarlosroldan jcarlosroldan added the feature request I want this in the app label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request I want this in the app
Projects
None yet
Development

No branches or pull requests

1 participant