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

[NFR]: Multiple parameter and return types #2428

Open
noone-silent opened this issue May 10, 2024 · 2 comments
Open

[NFR]: Multiple parameter and return types #2428

noone-silent opened this issue May 10, 2024 · 2 comments

Comments

@noone-silent
Copy link

Allow multiple class return types:

test() -> <Model> | <Row> | null
// or
test() -> <Model | Row> | null

Allow multiple parameter types:

test(array | null data) -> void
@Jeckerson
Copy link
Member

Allow multiple class return types

This feature already exists.

@noone-silent
Copy link
Author

Allow multiple class return types

This feature already exists.

Probably in C, but not in the generated stub files:

  • Download cphalcon
  • Change Method return types of findFirst to <ModelInterface> | <Row> | null
  • generate, compile and create stubs

Generated stubs is:

     * @return \Phalcon\Mvc\ModelInterface|\Phalcon\Mvc\Model\Row|null
     */
    public static function findFirst($parameters = null): ModelInterface|null
    {
    }

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

No branches or pull requests

2 participants