We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello
we need something like this
<?php declare(strict_types=1); namespace App\Psalm; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassLike; use Psalm\Codebase; use Psalm\FileSource; use Psalm\Plugin\Hook\AfterClassLikeVisitInterface; use Psalm\Storage\ClassLikeStorage; use Symfony\Contracts\Service\Attribute\Required; class RequiredPropertyHandler implements AfterClassLikeVisitInterface { public static function afterClassLikeVisit( ClassLike $stmt, ClassLikeStorage $storage, FileSource $statements_source, Codebase $codebase, array &$file_replacements = [] ) { if (!$stmt instanceof Class_) { return; } foreach ($storage->properties as $name => $property) { foreach ($property->attributes as $attribute) { if (Required::class === $attribute->fq_class_name) { $storage->initialized_properties[$name] = true; break; } } } } }
The text was updated successfully, but these errors were encountered:
hi @Punk-UnDeaD,
Thank you for the issue. The code seems valid. Can you please create a PR for it?
Sorry, something went wrong.
No branches or pull requests
Hello
we need something like this
The text was updated successfully, but these errors were encountered: