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 additional ways to mark parameters as unused that other tools can use? #3946

Open
TysonAndre opened this issue Aug 5, 2020 · 0 comments

Comments

@TysonAndre
Copy link
Contributor

TysonAndre commented Aug 5, 2020

With PHP 8.0 unexpectedly adding named argument support, renaming parameters to indicate that they're unused turned out to be a mistake for me to suggest (months before learning about that).

            'possiblyUnusedParamWithUnusedPrefix' => [
                '<?php
                    class A {
                        public static function foo(int $unusedArg = null) : void {}
                    }

                    A::foo();',
            ],

Instead, it would be useful to add @unused-param as a modifier - see phan/ProposedAnnotations#1
(e.g. with syntax such as the following)

/**
 * @param $x @unused-param
 * @param int $y
 * @unused-param $y
 * @unused-param ...$args
 */
function example(int $x, int $y, ...$args) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants