rector: TypedPropertyRector does not remove docblocks

rector.yaml:

parameters:
    php_version_features: '7.4'

services:
    Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector: ~
    Rector\Php74\Rector\Property\TypedPropertyRector: ~
    /** @var string */
    public $name;

becomes

    /** @var string */
    public string $name;

I expect it to be

    public string $name;

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 16 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll look at it this week

no_superfluous_phpdoc_tags does not support this.

Not yet, it will be in the scope as it was for the return/param types

I more than willing to submit a PR if you’re open for it.

If you’re up for it, I’d be happy to merge 👍

no_superfluous_phpdoc_tags does not support this.

Honestly Rector should support it… you even listed it in your blog post because it’s the logical thing to do. Maybe a separate rector? I more than willing to submit a PR if you’re open for it.

Thanks

@TomasVotruba I believe the PR I created should address this as you requested.

In that case you should update the docs and your blog post

Screen Shot 2019-11-30 at 09 39 02