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

Function type hints #36

Closed
mgrip opened this issue Feb 14, 2018 · 3 comments · Fixed by #126
Closed

Function type hints #36

mgrip opened this issue Feb 14, 2018 · 3 comments · Fixed by #126
Assignees
Labels

Comments

@mgrip
Copy link
Contributor

mgrip commented Feb 14, 2018

input:

function type_hinting_test(array $test, int $int_test, string $string_test = '') {
    return $int_test;
}

output:

function type_hinting_test($test, $int_test, $string_test = '') {
    return $int_test;
}
@czosel
Copy link
Collaborator

czosel commented Feb 15, 2018

Mostly fixed in #35, but let's leave this issue open until support for array and callable are possible (glayzzle/php-parser#113)

@mathieutu
Copy link

There is also a problem with '?' (for nullable)
Input:

public function for(?User $user)
    {
        $this->user = $user;

        return $this;
    }

Output:

 public function for(User $user)
    {
        $this->user = $user;

        return $this;
    }

@alexander-akait
Copy link
Member

@mathieutu thanks

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

Successfully merging a pull request may close this issue.

5 participants