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

Support @no-named-arguments to indicate userland function does not expect named variadic arguments #4580

Closed
TysonAndre opened this issue Oct 11, 2021 · 0 comments
Labels
enhancement This improves the quality of Phan's analysis of a codebase php8 Tracks changes to prepare for analyzing php 8 code

Comments

@TysonAndre
Copy link
Member

  1. Variadic array type should be inferred as list<X> instead of X[]
  2. Phan should warn about calls with unpacking string keys, literal named arguments, etc.
<?php
/**
 * @no-named-arguments
 * @param string|int|float ...$args
 */
function foo(string $format, ...$args) {
    printf("$format", ...$args);
}
@TysonAndre TysonAndre added enhancement This improves the quality of Phan's analysis of a codebase php8 Tracks changes to prepare for analyzing php 8 code labels Oct 11, 2021
TysonAndre added a commit to TysonAndre/phan that referenced this issue Oct 11, 2021
TysonAndre added a commit to TysonAndre/phan that referenced this issue Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This improves the quality of Phan's analysis of a codebase php8 Tracks changes to prepare for analyzing php 8 code
Projects
None yet
Development

No branches or pull requests

1 participant