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

ODM always-read and written properties #613

Open
aivchen opened this issue Oct 3, 2024 · 0 comments
Open

ODM always-read and written properties #613

aivchen opened this issue Oct 3, 2024 · 0 comments

Comments

@aivchen
Copy link

aivchen commented Oct 3, 2024

Hi!
Thank you for this project - it's awesome and we use it a lot!

But I noticed, currently, phpstan-doctrine doesn't support analysing of always-read and written properties in ODM documents like this:

/**
 * @ODM\Document
 */
class MyDocument
{

	/** @ODM\Id */
	private int $id;

	/** @ODM\Field */
	private int $myField;

	private int $unused;

}

PHPStan reports that all three properties are unused.

I found src/Rules/Doctrine/ORM/PropertiesExtension.php but it's working only with ORM entities.

I don't have experience in writing extension for PHPStan, but I think I can write a similar implementation for ODM by analogy with ORM.
What do you think?

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