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

deprecated trait should turn all methods deprecated #128

Open
staabm opened this issue Dec 19, 2024 · 1 comment
Open

deprecated trait should turn all methods deprecated #128

staabm opened this issue Dec 19, 2024 · 1 comment

Comments

@staabm
Copy link
Contributor

staabm commented Dec 19, 2024

<?php

declare(strict_types=1);

/**
 * @deprecated use something else
 */
trait MyTrait
{
	public function doFoo()
	{
	}
}

class X
{
	use MyTrait;
}

$x = new X();
$x->doFoo();

I think we should see deprecation messages for every trait-method beeing called, when the trait itself is marked deprecated.

@staabm
Copy link
Contributor Author

staabm commented Dec 19, 2024

btw: I noticed the playground does not trigger deprecation errors
https://phpstan.org/r/6c4f49bd-a460-43a7-b793-5bd175588e70

might be helpful to add this extension to the playground

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

1 participant